x-env-mapping: &env # https://docs.docker.com/compose/environment-variables/envvars-precedence/ env_file: - .env environment: - CELERY_BROKER_URL=amqp://olympia:olympia@rabbitmq/olympia - CELERY_RESULT_BACKEND=redis://redis:6379/1 - DATABASES_DEFAULT_URL=mysql://root:@mysqld/olympia - ELASTICSEARCH_LOCATION=http://elasticsearch:9200 - MEMCACHE_LOCATION=memcached:11211 - MYSQL_DATABASE=olympia - MYSQL_ROOT_PASSWORD=docker - SITE_URL=http://olympia.test - PYTHONDONTWRITEBYTECODE=1 - PYTHONUNBUFFERED=1 - PYTHONBREAKPOINT=ipdb.set_trace - TERM=xterm-256color - HISTFILE=/data/olympia/docker/artifacts/bash_history - HISTSIZE=50000 - HISTIGNORE=ls:exit:"cd .." - HISTCONTROL=erasedups - ENV=local - SWAGGER_UI_ENABLED=true - SKIP_DATA_SEED - FXA_CLIENT_ID - FXA_CLIENT_SECRET - &static_url_prefix STATIC_URL_PREFIX=/static-server/ - MEDIA_URL_PREFIX=/user-media/ x-olympia: &olympia <<: *env image: ${DOCKER_TAG:-mozilla/addons-server} # We don't want docker compose to manage the image for us. # We sometimes build the image locally and sometimes pull from a registry # but docker compose should always assume the image is available. pull_policy: never # We drop down to a different user through entrypoint.sh, but starting as # root allows us to fix the ownership of files generated at image build # time through the ./docker/entrypoint.sh script. user: root platform: linux/amd64 entrypoint: ["/data/olympia/docker/entrypoint.sh"] services: static: <<: *olympia ports: - "5173:5173" volumes: - ./:/data/olympia - ./deps:/data/olympia/deps command: make run_vite worker: <<: *olympia command: [ "DJANGO_SETTINGS_MODULE=settings", "watchmedo", "auto-restart", "--directory=/data/olympia/src", "--pattern=*.py", "--recursive", "--no-restart-on-command-exit", "--", "celery -A olympia.amo.celery:app worker -E -c 2 --loglevel=INFO", ] volumes: - ./:/data/olympia extra_hosts: - "olympia.test:127.0.0.1" restart: on-failure:5 healthcheck: test: ["CMD-SHELL", "./manage.py monitors --services celery_worker --skip-checks"] interval: 30s retries: 3 start_interval: 1s start_period: 10s depends_on: - mysqld - elasticsearch - redis - memcached - rabbitmq - autograph web: extends: service: worker command: - DJANGO_SETTINGS_MODULE=settings uwsgi --ini /data/olympia/docker/uwsgi.ini healthcheck: test: ["CMD-SHELL", "./manage.py monitors --services localdev_web --skip-checks"] interval: 30s retries: 3 start_interval: 1s start_period: 10s nginx: image: nginx:1.31.7@sha256:8632b3314d74c61f0e27f59055bab13f7793b988c94c090154d867bc29e0f39b <<: *env volumes: - data_nginx:/etc/nginx/templates - ./:/srv ports: - "80:80" networks: default: aliases: - olympia.test depends_on: - web - pinguino memcached: image: memcached:1.5.16@sha256:9655004969fb55e163c665f1c485f48b48784d3eb54c210882103f54d7d842d1 mysqld: image: mysql:8.4.11@sha256:0f51e63e537a1f176423fa03ef559aabe6fa4372a53160a44bc7e75da7d15364 environment: - MYSQL_ALLOW_EMPTY_PASSWORD=yes - MYSQL_DATABASE=olympia ports: - "3306:3306" volumes: - data_mysqld:/var/lib/mysql command: # Optimize for development speed over durability - --innodb-flush-log-at-trx-commit=0 - --innodb-buffer-pool-size=64M - --innodb-log-buffer-size=8M - --innodb-redo-log-capacity=64M # Skip DNS lookups - --skip-name-resolve # Disable performance schema for faster startup - --performance-schema=OFF healthcheck: test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "--silent"] start_interval: 1s timeout: 2s start_period: 10s retries: 3 elasticsearch: image: elasticsearch:8.19.23@sha256:ef5cafd961d7e273f13fed8def82e63c5ae0491106b5eecb5a69aa12d64f089b environment: # Disable all xpack related features to avoid unrelated logging # in docker logs. https://github.com/mozilla/addons-server/issues/8887 # This also avoids us to require authentication for local development # which simplifies the setup. - xpack.security.enabled=false - xpack.graph.enabled=false - xpack.watcher.enabled=false - "discovery.type=single-node" - "ES_JAVA_OPTS=-Xms512m -Xmx512m" mem_limit: 2g redis: image: redis:6.2.24@sha256:a08354a6199cf1008897c893e1a679e6cf7ee803ee9f34a50b991b8200a0e8dc volumes: - data_redis:/data rabbitmq: image: rabbitmq:3.13.7@sha256:87178a0ee3e2f52980ba356d38646ed1056705ff2d5ff281f8965456eaa0c1e3 hostname: olympia expose: - "5672" environment: - RABBITMQ_DEFAULT_USER=olympia - RABBITMQ_DEFAULT_PASS=olympia - RABBITMQ_DEFAULT_VHOST=olympia # 2h like it is set on CloudAMQP instances - RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit consumer_timeout 7200000 volumes: - data_rabbitmq:/var/lib/rabbitmq autograph: image: mozilla/autograph:8.0.0@sha256:2c6f008960e234f19d498547ce0a482501193902fcab7b66b6250e9bf0197490 command: /go/bin/autograph -c /data/autograph/autograph_localdev_config.yaml volumes: - data_autograph:/data/autograph addons-frontend: <<: *env image: mozilla/addons-frontend:2026.10.29@sha256:ec2a395faae13e7e364b142c3133eb4630a49cf675f9c03c0a9c36e505cb3859 platform: linux/amd64 environment: # We change the proxy port (which is the main entrypoint) as well as the # webpack port to avoid a conflict in case someone runs both addons-server # and addons-frontend locally, with the frontend configured to access # addons-server locally. - PROXY_PORT=7010 - WEBPACK_SERVER_PORT=7011 ports: # We need to expose this port so that statics can be fetched (they are # exposed using webpack and not by the node app server). - 7011:7011 command: yarn amo:olympia # Pinguino (Lit DevHub rebuild). Runs as its own service so its Node and Vite # toolchain stays separate from the olympia image and the legacy frontend pipeline. pinguino: image: node:24-slim@sha256:ba849c60be29959425b8734d57b8b4b7d56f98edd9504c9af091d5281095a71e platform: linux/amd64 working_dir: /app # The browser reaches Vite through nginx on :80, so the HMR socket must # target that port rather than the unpublished dev-server port. # NODE_AUTH_TOKEN (from .env) lets npm ci pull @mozilla/acorn-web-components # from GitHub Packages; the .npmrc references it. environment: - VITE_HMR_CLIENT_PORT=80 - NODE_AUTH_TOKEN=${NODE_AUTH_TOKEN:-} # Reuse the same value as the olympia services (see the &env block) so the # vite dev server's base (STATIC_URL_PREFIX + pinguino/) matches what nginx # proxies here and what devhub.views.serve_pinguino fetches. - *static_url_prefix volumes: - ./src/pinguino/devhub:/app # Keep deps inside the container so they never mix with the host or olympia. - pinguino_node_modules:/app/node_modules command: sh -c "npm ci || npm install; npm run dev" expose: - "5273" networks: default: driver: bridge enable_ipv6: false volumes: pinguino_node_modules: # Volume for rabbitmq/redis to avoid anonymous volumes data_rabbitmq: data_redis: data_mysqld: # Keep this value in sync with Makefile-os # External volumes must be manually created/destroyed name: addons-server_data_mysqld external: true # Volume for nginx configuration data_nginx: driver: local driver_opts: type: none o: bind device: ${PWD}/docker/nginx # Volume for autograph configuration data_autograph: driver: local driver_opts: type: none o: bind device: ${PWD}/docker/autograph