-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
113 lines (106 loc) · 3.55 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
version: '2.1'
services:
worker: &worker
image: quay.io/mozmar/kuma_base
command: ./manage.py celery worker --loglevel=INFO --events --beat --autoreload --concurrency=4 -Q mdn_purgeable,mdn_search,mdn_emails,mdn_wiki,celery
user: ${UID:-33}
volumes:
- ./:/app:z
depends_on:
- memcached
- mysql
- elasticsearch
- redis
- kumascript
environment:
# Django settings overrides:
- ACCOUNT_DEFAULT_HTTP_PROTOCOL=http
- ALLOWED_HOSTS=*
- ATTACHMENT_HOST=${ATTACHMENT_HOST:-localhost:8000}
- 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=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}
- MEMCACHE_SERVERS=memcached:11211
- PROTOCOL=http://
- SESSION_COOKIE_SECURE=False
- SITE_URL=http://localhost:8000
- STATIC_URL=${STATIC_URL:-/static/}
# Other environment overrides
- PYTHONDONTWRITEBYTECODE=1
- PYTHONUNBUFFERED=True
- MAINTENANCE_MODE=${MAINTENANCE_MODE:-False}
- REVISION_HASH=${KUMA_REVISION_HASH:-undefined}
# 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
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:
- memcached
- mysql
- elasticsearch
- redis
# Drop kumascript link
ports:
- "8001:8000"
memcached:
image: memcached
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: elasticsearch:2.4
redis:
image: redis
kumascript:
image: quay.io/mozmar/kumascript
command: node run.js
depends_on:
- api
- memcached
environment:
- interactive_examples__base_url=${INTERACTIVE_EXAMPLES_BASE:-https://interactive-examples.mdn.mozilla.net}
- log__console=true
- log__file=
- server__template_root_dir=macros
- server__document_url_template=http://api:8000/en-US/docs/{path}?raw=1
- server__memcache__server=memcached:11211
- server__template_class=EJSTemplate
- server__autorequire__mdn=MDN:Common
- server__autorequire__Page=DekiScript:Page
- server__autorequire__String=DekiScript:String
- server__autorequire__Uri=DekiScript:Uri
- server__autorequire__Web=DekiScript:Web
- server__autorequire__Wiki=DekiScript:Wiki
ports:
- "9080:9080"
volumes:
- ./kumascript:/app
volumes:
mysqlvolume: