services: # Run webpack-dev-server and compile static assets. # # This is the primary server and it proxies the # Django app so that Webpack can watch for file changes. assets: build: context: . target: assets image: mozmeao/springfield_assets:${GIT_COMMIT:-latest} platform: linux/amd64 command: npm run watch ports: - "8000-8010:8000-8010" volumes: - ./media/:/app/media:delegated - ./springfield/:/app/springfield:delegated - ./assets/:/app/assets:delegated - ./webpack.config.js:/app/webpack.config.js:delegated environment: WP_PROXY_URL: "http://app:8080" # the django app app: build: context: . target: devapp image: mozmeao/springfield_test:${GIT_COMMIT:-latest} platform: linux/amd64 tty: true stdin_open: true command: python manage.py runserver 0.0.0.0:8080 env_file: - docker/envfiles/local.env - .env ports: - "8080:8080" volumes: - ./data/:/app/data - media_volume:/app/custom-media - ./springfield/:/app/springfield:delegated - ./bin/:/app/bin:delegated - ./docker/:/app/docker:delegated - ./etc/:/app/etc:delegated - ./lib/:/app/lib:delegated - ./media/:/app/media:delegated - ./root_files/:/app/root_files:delegated - ./scripts/:/app/scripts:delegated - ./wsgi/:/app/wsgi:delegated - ./locale/:/app/locale:delegated - ./l10n/:/app/l10n:delegated - ./assets/:/app/assets:delegated # Standalone postgres database - for local runserver development. # TODO: add this as a dependency of app/test/release db: image: postgres:15-alpine environment: POSTGRES_PASSWORD: springfield POSTGRES_USER: springfield ports: - "5432:5432" redis: image: redis platform: linux/amd64 worker: image: mozmeao/springfield_test:${GIT_COMMIT:-latest} platform: linux/amd64 restart: unless-stopped volumes: - .:/app env_file: - docker/envfiles/local.env - .env depends_on: - db - redis command: ./bin/run-worker.sh # run the tests against local changes test: image: mozmeao/springfield_test:${GIT_COMMIT:-latest} env_file: docker/envfiles/test.env volumes: - ./springfield/:/app/springfield:delegated - ./bin/:/app/bin:delegated - ./docker/:/app/docker:delegated - ./etc/:/app/etc:delegated - ./lib/:/app/lib:delegated - ./media/:/app/media:delegated - ./root_files/:/app/root_files:delegated - ./scripts/:/app/scripts:delegated - ./tests/:/app/tests:delegated - ./test_infra/:/app/test_infra:delegated - ./wsgi/:/app/wsgi:delegated - ./l10n/:/app/l10n:delegated # run tests with no volumes test-image: image: mozmeao/springfield_test:${GIT_COMMIT:-latest} env_file: docker/envfiles/test.env # the django app release: build: context: . target: release args: GIT_SHA: ${GIT_COMMIT:-latest} image: mozmeao/springfield:${GIT_COMMIT:-latest} platform: linux/amd64 release-local: image: mozmeao/springfield:${GIT_COMMIT:-latest} env_file: - docker/envfiles/local.env - .env environment: RUN_SUPERVISOR: "true" ports: - "8000:8000" volumes: - ./springfield/:/app/springfield:delegated - ./bin/:/app/bin:delegated - ./docker/:/app/docker:delegated - ./etc/:/app/etc:delegated - ./lib/:/app/lib:delegated - ./root_files/:/app/root_files:delegated - ./scripts/:/app/scripts:delegated - ./wsgi/:/app/wsgi:delegated - ./locale/:/app/locale:delegated - ./l10n/:/app/l10n:delegated playwright-visual-regression: image: mcr.microsoft.com/playwright:v1.63.0-noble platform: linux/amd64 network_mode: host working_dir: /app/tests/playwright volumes: - ./tests/playwright:/app/tests/playwright - playwright_node_modules:/app/tests/playwright/node_modules environment: PLAYWRIGHT_BASE_URL: "${PLAYWRIGHT_BASE_URL:-http://localhost:8000}" command: sh -c "npm install && npx playwright test --config playwright.visual-regression.config.js" playwright-visual-regression-ui: image: mcr.microsoft.com/playwright:v1.63.0-noble platform: linux/amd64 network_mode: host working_dir: /app/tests/playwright volumes: - ./tests/playwright:/app/tests/playwright - playwright_node_modules:/app/tests/playwright/node_modules environment: PLAYWRIGHT_BASE_URL: "${PLAYWRIGHT_BASE_URL:-http://localhost:8000}" command: sh -c "npm install && npx playwright test --config playwright.visual-regression.config.js --ui --ui-host=0.0.0.0 --ui-port=8085" playwright-update-snapshots: image: mcr.microsoft.com/playwright:v1.63.0-noble platform: linux/amd64 network_mode: host working_dir: /app/tests/playwright volumes: - ./tests/playwright:/app/tests/playwright - playwright_node_modules:/app/tests/playwright/node_modules environment: PLAYWRIGHT_BASE_URL: "${PLAYWRIGHT_BASE_URL:-http://localhost:8000}" command: sh -c "npm install && npx playwright test --config playwright.visual-regression.config.js --update-snapshots" builder: build: context: . target: python-builder image: mozmeao/springfield_build:${GIT_COMMIT:-latest} platform: linux/amd64 app-base: build: context: . target: app-base image: mozmeao/springfield_code:${GIT_COMMIT:-latest} platform: linux/amd64 # Python dependency management compile-requirements: build: context: . target: uv-lock platform: linux/amd64 command: ./bin/compile-requirements.sh volumes: - .:/app volumes: media_volume: playwright_node_modules: