-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
132 lines (125 loc) · 4.14 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
version: '2.1'
services:
worker: &worker
image: mdnwebdocs/kuma_base
command: ./manage.py celery worker --loglevel=INFO --events --beat --autoreload --concurrency=4 -Q mdn_purgeable,mdn_search,mdn_emails,mdn_wiki,mdn_api,celery
user: ${UID:-1000}
volumes:
- ./:/app:z
depends_on:
- mysql
- elasticsearch
- redis
- kumascript
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:-}
- BROKER_URL=redis://redis:6379/0
- CELERY_ALWAYS_EAGER=False
- CELERY_RESULT_BACKEND=redis://redis:6379/1
- CSRF_COOKIE_SECURE=False
- DATABASE_URL=mysql://${DATABASE_USER:-root}:${DATABASE_PASSWORD:-kuma}@mysql:3306/developer_mozilla_org
- DEBUG=${DEBUG:-True}
- DOMAIN=${DOMAIN:-localhost}
- ENABLE_RESTRICTIONS_BY_HOST=${ENABLE_RESTRICTIONS_BY_HOST:-False}
- ES_URLS=elasticsearch:9200
- INTERACTIVE_EXAMPLES_BASE=${INTERACTIVE_EXAMPLES_BASE:-https://interactive-examples.mdn.mozilla.net}
- KUMASCRIPT_URL_TEMPLATE=http://kumascript:9080/docs/{path}
- 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/}
- WAFFLE_COOKIE_SECURE=False
# Other environment overrides
- PYTHONDONTWRITEBYTECODE=1
- PYTHONUNBUFFERED=True
- PYTHONWARNINGS=${PYTHONWARNINGS:-default}
- MAINTENANCE_MODE=${MAINTENANCE_MODE:-False}
- REVISION_HASH=${KUMA_REVISION_HASH:-undefined}
# For the server side rendering server and the code that connects to it.
- SSR_PORT=8000
- SSR_URL=http://ssr:8000/ssr
- SSR_TIMEOUT=1
# Web is based on worker b/c you cannot clear the "ports" with docker-compose.
web:
<<: *worker
command: gunicorn -w 4 --bind 0.0.0.0:8000 --access-logfile=- --timeout=120 --worker-class=meinheld.gmeinheld.MeinheldWorker kuma.wsgi:application
depends_on:
- mysql
- elasticsearch
- redis
- kumascript
- ssr
ports:
- "8000:8000"
# API is used by KumaScript for content and metadata
api:
<<: *worker
command: gunicorn -w 4 --bind 0.0.0.0:8000 --access-logfile=- --timeout=120 kuma.wsgi:application
depends_on:
- mysql
- elasticsearch
- redis
ports:
- "8001:8000"
# ssr is a Node server that performs server-side rendering of our React UI
ssr:
<<: *worker
command: node kuma/javascript/ssr-server.js
depends_on: []
ports:
- "8002:8000"
mysql:
image: mysql:5.6
environment:
- MYSQL_USER=kuma
- MYSQL_PASSWORD=kuma
- MYSQL_DATABASE=developer_mozilla_org
- MYSQL_ROOT_PASSWORD=kuma
command:
- mysqld
- --character-set-server=utf8
- --collation-server=utf8_general_ci
- --innodb-flush-log-at-trx-commit=0
- --innodb-log-file-size=132M
- --max-allowed-packet=100M
volumes:
- mysqlvolume:/var/lib/mysql
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.7.1
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- ES_JAVA_OPTS=-Xms512m -Xmx512m
ports:
- "9200:9200"
volumes:
- esdata:/usr/share/elasticsearch/data
redis:
image: redis
kumascript:
image: mdnwebdocs/kumascript
command: node run.js
depends_on:
- api
- redis
environment:
- DOCUMENT_URL_TEMPLATE=http://api:8000/en-US/docs/{path}?raw=1&redirect=no
- DOCUMENT_URL=http://api:8000
- INTERACTIVE_EXAMPLES_URL=${INTERACTIVE_EXAMPLES_BASE:-https://interactive-examples.mdn.mozilla.net}
- LIVE_SAMPLES_URL=http://${ATTACHMENT_HOST:-localhost:8000}
- REDIS_URL=redis://redis:6379/2
ports:
- "9080:9080"
volumes:
- ./kumascript:/app
volumes:
mysqlvolume:
esdata:
driver: local