forked from mdn/kuma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
86 lines (81 loc) · 2.85 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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: