-
Notifications
You must be signed in to change notification settings - Fork 414
/
docker-compose.yml
166 lines (150 loc) · 5.79 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
version: "3.7"
services:
############# External services
{% if ACTIVATE_MEMCACHED %}
memcached:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_MEMCACHED }}
restart: unless-stopped
{% endif %}
{% if ACTIVATE_MONGODB %}
mongodb:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_MONGODB }}
# Use WiredTiger in all environments, just like at edx.org
command: mongod --smallfiles --nojournal --storageEngine wiredTiger
restart: unless-stopped
volumes:
- ../../data/mongodb:/data/db
{% endif %}
{% if ACTIVATE_MYSQL %}
mysql:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_MYSQL }}
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci
restart: unless-stopped
volumes:
- ../../data/mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: "{{ MYSQL_ROOT_PASSWORD }}"
{% endif %}
{% if ACTIVATE_ELASTICSEARCH %}
elasticsearch:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_ELASTICSEARCH }}
command: ["elasticsearch", "-Xms{{ ELASTICSEARCH_HEAP_SIZE }}", "-Xmx{{ ELASTICSEARCH_HEAP_SIZE }}", "--cluster.name=openedx", "--bootstrap.mlockall=true"]
ulimits:
memlock:
soft: -1
hard: -1
restart: unless-stopped
volumes:
- ../../data/elasticsearch:/usr/share/elasticsearch/data
{% endif %}
{% if ACTIVATE_RABBITMQ %}
rabbitmq:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_RABBITMQ }}
volumes:
- ../../data/rabbitmq:/var/lib/rabbitmq
restart: unless-stopped
{% endif %}
{% if ACTIVATE_SMTP %}
smtp:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_SMTP }}
restart: unless-stopped
{% endif %}
############# Forum
{% if ACTIVATE_FORUM %}
forum:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_FORUM }}
environment:
SEARCH_SERVER: "{{ ELASTICSEARCH_SCHEME }}://{{ ELASTICSEARCH_HOST }}:{{ ELASTICSEARCH_PORT }}"
MONGODB_AUTH: "{% if MONGODB_USERNAME and MONGODB_PASSWORD %}{{ MONGODB_USERNAME}}:{{ MONGODB_PASSWORD }}@{% endif %}"
MONGODB_HOST: "{{ MONGODB_HOST }}"
MONGODB_PORT: "{{ MONGODB_PORT }}"
restart: unless-stopped
depends_on: {{ [("elasticsearch", ACTIVATE_ELASTICSEARCH), ("mongodb", ACTIVATE_MONGODB)]|list_if }}
{% endif %}
############# LMS and CMS
{% if ACTIVATE_LMS %}
lms:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX }}
environment:
SERVICE_VARIANT: lms
GUNICORN_WORKERS: {{ OPENEDX_LMS_GUNICORN_WORKERS }}
SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production}
restart: unless-stopped
volumes:
- ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/
- ../apps/openedx/settings/cms/:/openedx/edx-platform/cms/envs/tutor/
- ../apps/openedx/config/:/openedx/config/
- ../../data/lms:/openedx/data
- ../../data/openedx-media:/openedx/media
depends_on:
- mysql
{% if ACTIVATE_ELASTICSEARCH %}- elasticsearch{% endif %}
{% if ACTIVATE_FORUM %}- forum{% endif %}
{% if ACTIVATE_MEMCACHED %}- memcached{% endif %}
{% if ACTIVATE_MONGODB %}- mongodb{% endif %}
{% if ACTIVATE_RABBITMQ %}- rabbitmq{% endif %}
{% if ACTIVATE_SMTP %}- smtp{% endif %}
{{ patch("local-docker-compose-lms-dependencies")|indent(6) }}
{% endif %}
{% if ACTIVATE_CMS %}
cms:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX }}
environment:
SERVICE_VARIANT: cms
GUNICORN_WORKERS: {{ OPENEDX_CMS_GUNICORN_WORKERS }}
SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production}
restart: unless-stopped
volumes:
- ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/
- ../apps/openedx/settings/cms/:/openedx/edx-platform/cms/envs/tutor/
- ../apps/openedx/config/:/openedx/config/
- ../../data/cms:/openedx/data
- ../../data/openedx-media:/openedx/media
depends_on:
- mysql
{% if ACTIVATE_ELASTICSEARCH %}- elasticsearch{% endif %}
{% if ACTIVATE_MEMCACHED %}- memcached{% endif %}
{% if ACTIVATE_MONGODB %}- mongodb{% endif %}
{% if ACTIVATE_RABBITMQ %}- rabbitmq{% endif %}
{% if ACTIVATE_SMTP %}- smtp{% endif %}
{% if ACTIVATE_LMS %}- lms{% endif %}
{{ patch("local-docker-compose-cms-dependencies")|indent(6) }}
{% endif %}
############# LMS and CMS workers
{% if ACTIVATE_LMS %}
lms-worker:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX }}
environment:
SERVICE_VARIANT: lms
SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production}
C_FORCE_ROOT: "1" # run celery tasks as root #nofear
command: ./manage.py lms celery worker --loglevel=info --hostname=edx.lms.core.default.%%h --maxtasksperchild 100
restart: unless-stopped
volumes:
- ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/
- ../apps/openedx/settings/cms/:/openedx/edx-platform/cms/envs/tutor/
- ../apps/openedx/config/:/openedx/config/
- ../../data/lms:/openedx/data
- ../../data/openedx-media:/openedx/media
depends_on:
- lms
{% endif %}
{% if ACTIVATE_CMS %}
cms-worker:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX }}
environment:
SERVICE_VARIANT: cms
SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production}
C_FORCE_ROOT: "1" # run celery tasks as root #nofear
command: ./manage.py cms celery worker --loglevel=info --hostname=edx.cms.core.default.%%h --maxtasksperchild 100 --exclude-queues=edx.lms.core.default
restart: unless-stopped
volumes:
- ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/
- ../apps/openedx/settings/cms/:/openedx/edx-platform/cms/envs/tutor/
- ../apps/openedx/config/:/openedx/config/
- ../../data/cms:/openedx/data
- ../../data/openedx-media:/openedx/media
depends_on:
- cms
{% endif %}
{{ patch("local-docker-compose-services")|indent(2) }}