Emi Matchu
7a357f1556
Previously the `docker-compose.yml` we copied from GlitchTip's instructions didn't specify a version tag. I don't know a ton about Docker, but I imagine the deal here is that this means that we could have used some Docker command like `docker pull` to update what version of `glitchtip/glitchtip` is stored in our local image store or something? Anyway, I wanted to upgrade to version 4.0 (I'm not even actually sure what version we were on before), and so the way I chose to do this was to add a version specifier to the `docker-compose.yml` file. Then, all we had to do was deploy it as usual, and Docker seemed to handle downloading the image when starting up the service the next time, and auto-performed the migrations, if I'm understanding correctly. (I did see migrations being performed in the logs!) Great!
58 lines
1.9 KiB
YAML
58 lines
1.9 KiB
YAML
version: "3.8"
|
|
|
|
# NOTE: We override many of these in our secret `glitchtip-conf.env` file,
|
|
# which we provide as the `env_file` to some of the services below!
|
|
x-environment: &default-environment
|
|
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
|
|
# SECRET_KEY: change_me # best to run openssl rand -hex 32
|
|
PORT: 8000
|
|
# EMAIL_URL: consolemail:// # Example smtp://email:password@smtp_url:port https://glitchtip.com/documentation/install#configuration
|
|
# GLITCHTIP_DOMAIN: https://app.glitchtip.com # Change this to your domain
|
|
# DEFAULT_FROM_EMAIL: email@glitchtip.com # Change this to your email
|
|
CELERY_WORKER_AUTOSCALE: "1,3" # Scale between 1 and 3 to prevent excessive memory usage. Change it or remove to set it to the number of cpu cores.
|
|
CELERY_WORKER_MAX_TASKS_PER_CHILD: "10000"
|
|
|
|
x-depends_on: &default-depends_on
|
|
- postgres
|
|
- redis
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:15
|
|
environment:
|
|
POSTGRES_HOST_AUTH_METHOD: "trust" # Consider removing this and setting a password
|
|
restart: unless-stopped
|
|
volumes:
|
|
- pg-data:/var/lib/postgresql/data
|
|
redis:
|
|
image: redis
|
|
restart: unless-stopped
|
|
web:
|
|
image: glitchtip/glitchtip:v4.0
|
|
depends_on: *default-depends_on
|
|
ports:
|
|
- "8000:8000"
|
|
environment: *default-environment
|
|
restart: unless-stopped
|
|
volumes:
|
|
- uploads:/code/uploads
|
|
env_file: glitchtip-conf.env
|
|
worker:
|
|
image: glitchtip/glitchtip:v4.0
|
|
command: ./bin/run-celery-with-beat.sh
|
|
depends_on: *default-depends_on
|
|
environment: *default-environment
|
|
restart: unless-stopped
|
|
volumes:
|
|
- uploads:/code/uploads
|
|
env_file: glitchtip-conf.env
|
|
migrate:
|
|
image: glitchtip/glitchtip:v4.0
|
|
depends_on: *default-depends_on
|
|
command: "./manage.py migrate"
|
|
environment: *default-environment
|
|
env_file: glitchtip-conf.env
|
|
|
|
volumes:
|
|
pg-data:
|
|
uploads:
|