2019-05-17 00:56:02 +03:00
version : '3'
services :
backend :
container_name : backend
build :
context : .
dockerfile : docker/dev.Dockerfile
# TODO: Try using cache_from pointed at a Docker Hub image built from master
# Though may need to also use the workaround for local vs remote:
# https://github.com/moby/moby/issues/32612#issuecomment-294055017
# cache_from: TODO
image : treeherder-backend
2023-06-21 17:04:01 +03:00
platform : linux/amd64
2019-05-17 00:56:02 +03:00
environment :
# Development/CI-specific environment variables only.
# Those that do not vary across environments should go in `Dockerfile`.
- BROKER_URL=amqp://guest:guest@rabbitmq//
2024-05-30 16:19:56 +03:00
- DATABASE_URL=${DATABASE_URL:-psql://postgres:mozilla1234@postgres:5432/treeherder}
2020-03-10 21:29:07 +03:00
- GITHUB_TOKEN=${GITHUB_TOKEN:-}
2020-01-13 12:26:06 +03:00
- UPSTREAM_DATABASE_URL=${UPSTREAM_DATABASE_URL:-}
2020-03-09 10:08:50 +03:00
- PERF_SHERIFF_BOT_CLIENT_ID=${PERF_SHERIFF_BOT_CLIENT_ID:-}
- PERF_SHERIFF_BOT_ACCESS_TOKEN=${PERF_SHERIFF_BOT_ACCESS_TOKEN:-}
2021-04-07 10:58:12 +03:00
- NOTIFY_CLIENT_ID=${NOTIFY_CLIENT_ID:-}
- NOTIFY_ACCESS_TOKEN=${NOTIFY_ACCESS_TOKEN:-}
2020-03-25 21:40:22 +03:00
- PULSE_AUTO_DELETE_QUEUES=True
2019-05-17 00:56:02 +03:00
- REDIS_URL=redis://redis:6379
- SITE_URL=http://backend:8000/
- TREEHERDER_DEBUG=True
2020-03-17 00:25:11 +03:00
- NEW_RELIC_INSIGHTS_API_KEY=${NEW_RELIC_INSIGHTS_API_KEY:-}
2021-05-14 00:20:07 +03:00
- PROJECTS_TO_INGEST=${PROJECTS_TO_INGEST:-autoland,try}
2021-10-04 19:37:41 +03:00
- BUGZILLA_API_URL=${BUGZILLA_API_URL:-}
- BUG_FILER_API_KEY=${BUG_FILER_API_KEY:-}
- TLS_CERT_PATH=${TLS_CERT_PATH:-}
2019-05-17 00:56:02 +03:00
entrypoint : './docker/entrypoint.sh'
2020-03-20 21:58:11 +03:00
# We *ONLY* initialize the data when we're running the backend
2020-03-23 18:55:49 +03:00
command : './initialize_data.sh ./manage.py runserver 0.0.0.0:8000'
2019-05-17 00:56:02 +03:00
# Django's runserver doesn't listen to the default of SIGTERM, so docker-compose
# must send SIGINT instead to avoid waiting 10 seconds for the time out.
stop_signal : SIGINT
2020-12-21 23:54:07 +03:00
shm_size : 2g # 2 Gig seems like a good size
2019-05-17 00:56:02 +03:00
volumes :
- .:/app
ports :
- '8000:8000'
depends_on :
- redis
2023-07-06 14:58:32 +03:00
- postgres
2019-05-17 00:56:02 +03:00
- rabbitmq
2020-03-19 21:07:31 +03:00
stdin_open : true
tty : true
2019-05-17 00:56:02 +03:00
frontend :
container_name : frontend
# https://hub.docker.com/_/node
2023-01-05 01:58:12 +03:00
image : nikolaik/python-nodejs:python3.11-nodejs19-alpine
2019-05-17 00:56:02 +03:00
# Installing JS dependencies at runtime so that they share the `node_modules` from the
# host, improving speed (both install and build due to the webpack cache) and ensuring
# the host copy stays in sync (for people that switch back and forth between UI-only
# and full stack Treeherder development).
working_dir : /app
2022-07-13 12:17:50 +03:00
environment :
BACKEND : http://backend:8000
2023-01-05 01:58:12 +03:00
command : sh -c "yarn && yarn build:glean && yarn start --host 0.0.0.0"
2019-05-17 00:56:02 +03:00
volumes :
- .:/app
ports :
- '5000:5000'
2023-06-21 17:04:01 +03:00
platform : linux/amd64
2019-05-17 00:56:02 +03:00
2023-07-05 14:47:18 +03:00
postgres :
container_name : postgres
# https://hub.docker.com/r/library/postgres/
2023-07-13 12:12:49 +03:00
image : postgres:15-bullseye
2023-07-05 14:47:18 +03:00
environment :
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=mozilla1234
- POSTGRES_DB=treeherder
volumes :
- postgres_data:/var/lib/postgresql/data
ports :
- '5432:5432'
2019-05-17 00:56:02 +03:00
redis :
container_name : redis
# https://hub.docker.com/_/redis/
2024-04-08 09:52:42 +03:00
image : redis:7.0.15-alpine
2019-05-17 00:56:02 +03:00
# Messages after starting the redis-server
2023-06-20 13:33:04 +03:00
# WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
2019-05-17 00:56:02 +03:00
# Hide Redis `notice` log level startup output spam.
command : redis-server --loglevel warning
2020-02-05 22:55:03 +03:00
ports :
- '6379:6379'
2020-04-08 21:34:16 +03:00
2019-05-17 00:56:02 +03:00
rabbitmq :
container_name : rabbitmq
# https://hub.docker.com/r/library/rabbitmq/
2024-07-08 07:18:35 +03:00
image : rabbitmq:3.12.14-alpine
2019-05-17 00:56:02 +03:00
environment :
# Hide INFO and WARNING log levels to reduce log spam.
- 'RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit log [{console,[{level,error}]}]'
2020-02-05 22:55:03 +03:00
ports :
- '5672:5672'
2020-04-08 21:34:16 +03:00
2020-04-21 23:12:52 +03:00
pulse-task-push :
2020-04-08 21:34:16 +03:00
build :
context : .
dockerfile : docker/dev.Dockerfile
environment :
2022-01-31 13:24:21 +03:00
- PULSE_URL=${PULSE_URL:-}
2020-04-08 21:34:16 +03:00
- LOGGING_LEVEL=INFO
- PULSE_AUTO_DELETE_QUEUES=True
2024-05-30 16:19:56 +03:00
- DATABASE_URL=${DATABASE_URL:-psql://postgres:mozilla1234@postgres:5432/treeherder}
2020-04-08 21:34:16 +03:00
- BROKER_URL=amqp://guest:guest@rabbitmq//
2020-04-13 20:47:07 +03:00
- SKIP_INGESTION=${SKIP_INGESTION:-False}
2020-04-08 21:34:16 +03:00
entrypoint : './docker/entrypoint.sh'
2020-04-21 23:12:52 +03:00
command : ./manage.py pulse_listener
2020-04-08 21:34:16 +03:00
volumes :
- .:/app
depends_on :
2023-07-13 11:52:09 +03:00
- postgres
2020-04-08 21:34:16 +03:00
- rabbitmq
2023-06-21 17:04:01 +03:00
platform : linux/amd64
2020-04-08 21:34:16 +03:00
celery :
build :
context : .
dockerfile : docker/dev.Dockerfile
environment :
2022-05-06 00:30:20 +03:00
- BROKER_URL=amqp://guest:guest@rabbitmq:5672//
2024-05-30 16:19:56 +03:00
- DATABASE_URL=${DATABASE_URL:-psql://postgres:mozilla1234@postgres:5432/treeherder}
2021-05-14 00:20:07 +03:00
- PROJECTS_TO_INGEST=${PROJECTS_TO_INGEST:-autoland,try}
2020-04-08 21:34:16 +03:00
entrypoint : './docker/entrypoint.sh'
2023-11-21 22:37:53 +03:00
command : celery -A treeherder worker --uid=nobody --gid=nogroup --without-gossip --without-mingle --without-heartbeat -Q store_pulse_pushes,store_pulse_tasks,store_pulse_tasks_classification,statsd --concurrency=1 --loglevel=INFO
2020-04-08 21:34:16 +03:00
volumes :
- .:/app
depends_on :
2023-07-13 11:52:09 +03:00
- postgres
2020-04-08 21:34:16 +03:00
- redis
- rabbitmq
2023-06-21 17:04:01 +03:00
platform : linux/amd64
2023-11-21 22:37:53 +03:00
statsd :
container_name : statsd
image : statsd/statsd:v0.10.2
volumes :
- ./docker/statsd_config.js:/usr/src/app/config.js
ports :
- '8125:8125'
2024-08-02 00:38:57 +03:00
platform : linux/amd64
2023-11-21 22:37:53 +03:00
2019-05-17 00:56:02 +03:00
volumes :
# TODO: Experiment with using tmpfs when testing, to speed up database-using Python tests.
2023-07-05 14:47:18 +03:00
postgres_data : {}