version: "3.4" services: worker: &worker build: context: . dockerfile: docker/images/kuma_base/Dockerfile image: mdnwebdocs/kuma_base command: ./scripts/start-worker user: ${UID:-1000} volumes: - ./:/app:z depends_on: - postgres - redis environment: # Django settings overrides: - ACCOUNT_DEFAULT_HTTP_PROTOCOL=http - ALLOW_ALL_IFRAMES=${ALLOW_ALL_IFRAMES:-False} - ALLOWED_HOSTS=* - ATTACHMENT_HOST=${ATTACHMENT_HOST:-localhost:8000} - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-} - CELERY_BROKER_URL=redis://redis:6379/0 - CELERY_TASK_ALWAYS_EAGER=False - CELERY_RESULT_BACKEND=redis://redis:6379/1 - CSRF_COOKIE_SECURE=False - DATABASE_URL=postgresql://${POSTGRES_DATABASE_USER:-kuma}:${POSTGRES_DATABASE_PASSWORD:-kuma}@postgres:5432/developer_mozilla_org - DEBUG=${DEBUG:-True} - DOMAIN=${DOMAIN:-localhost} - ENABLE_RESTRICTIONS_BY_HOST=${ENABLE_RESTRICTIONS_BY_HOST:-False} - INTERACTIVE_EXAMPLES_BASE=${INTERACTIVE_EXAMPLES_BASE:-https://interactive-examples.mdn.mozilla.net} - REDIS_CACHE_SERVER=redis://redis:6379/3 - PROTOCOL=http:// - SESSION_COOKIE_SECURE=False - SITE_URL=${SITE_URL:-http://localhost:8000} - STATIC_URL=${STATIC_URL:-http://localhost:8000/static/} # Other environment overrides - PYTHONDONTWRITEBYTECODE=1 - PYTHONUNBUFFERED=True - PYTHONWARNINGS=${PYTHONWARNINGS:-} - MAINTENANCE_MODE=${MAINTENANCE_MODE:-False} - REVISION_HASH=${KUMA_REVISION_HASH:-undefined} - OIDC_RP_CLIENT_ID=${OIDC_RP_CLIENT_ID:-undefined} - OIDC_RP_CLIENT_SECRET=${OIDC_RP_CLIENT_SECRET:-undefined} # Web is based on worker b/c you cannot clear the "ports" with docker-compose. web: <<: *worker command: gunicorn -w ${GUNICORN_WORKERS:-4} --bind 0.0.0.0:8000 --access-logfile=- --timeout=120 --worker-class=gevent --reload kuma.wsgi:application stdin_open: true tty: true depends_on: - postgres - redis ports: - "8000:8000" # Used for ci testing testing: <<: *worker command: bash depends_on: - postgres - redis volumes: - ./:/app # https://hub.docker.com/_/postgres/ postgres: image: postgres:13.3 environment: # Create the superuser account - POSTGRES_USER=kuma - POSTGRES_PASSWORD=kuma - POSTGRES_DB=developer_mozilla_org volumes: - db:/var/lib/postgresql/data redis: # The version of this Redis image should be kept synchronized with production. It # should match the "redis_engine_version" variable in the following Terraform file: # https://github.com/mdn/infra/blob/main/apps/mdn/mdn-aws/infra/modules/multi_region/redis/variables.tf image: redis:5.0.6 volumes: db: