2020-01-10 09:55:08 +00:00
|
|
|
version: "3.7"
|
2017-07-03 10:39:19 +00:00
|
|
|
services:
|
|
|
|
|
2017-07-24 09:32:50 +00:00
|
|
|
############# External services
|
|
|
|
|
2019-03-20 17:59:09 +00:00
|
|
|
{% if ACTIVATE_MEMCACHED %}
|
2017-07-03 10:39:19 +00:00
|
|
|
memcached:
|
2019-03-18 21:39:35 +00:00
|
|
|
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_MEMCACHED }}
|
2018-02-08 06:40:18 +00:00
|
|
|
restart: unless-stopped
|
2019-03-20 17:59:09 +00:00
|
|
|
{% endif %}
|
2017-07-03 10:39:19 +00:00
|
|
|
|
2019-03-20 17:59:09 +00:00
|
|
|
{% if ACTIVATE_MONGODB %}
|
2017-07-03 10:39:19 +00:00
|
|
|
mongodb:
|
2019-03-18 21:39:35 +00:00
|
|
|
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_MONGODB }}
|
2017-07-03 10:39:19 +00:00
|
|
|
# Use WiredTiger in all environments, just like at edx.org
|
|
|
|
command: mongod --smallfiles --nojournal --storageEngine wiredTiger
|
2018-02-08 06:40:18 +00:00
|
|
|
restart: unless-stopped
|
2017-07-03 10:39:19 +00:00
|
|
|
volumes:
|
2018-12-03 18:59:09 +00:00
|
|
|
- ../../data/mongodb:/data/db
|
2019-03-20 17:59:09 +00:00
|
|
|
{% endif %}
|
2017-07-03 10:39:19 +00:00
|
|
|
|
|
|
|
mysql:
|
2019-03-18 21:39:35 +00:00
|
|
|
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_MYSQL }}
|
2019-09-03 08:36:10 +00:00
|
|
|
{% if ACTIVATE_MYSQL %}
|
2017-07-03 10:39:19 +00:00
|
|
|
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci
|
2019-09-03 08:36:10 +00:00
|
|
|
{% else %}
|
|
|
|
entrypoint: ["sh", "-e", "-c"]
|
|
|
|
command: ["echo 'ready'; while true; do sleep 60; done"]
|
|
|
|
{% endif %}
|
2018-02-08 06:40:18 +00:00
|
|
|
restart: unless-stopped
|
2017-07-03 10:39:19 +00:00
|
|
|
volumes:
|
2018-12-03 18:59:09 +00:00
|
|
|
- ../../data/mysql:/var/lib/mysql
|
2019-01-22 20:25:04 +00:00
|
|
|
env_file: ../apps/mysql/auth.env
|
2017-07-03 10:39:19 +00:00
|
|
|
|
2019-03-20 17:59:09 +00:00
|
|
|
{% if ACTIVATE_ELASTICSEARCH %}
|
2018-05-27 11:30:23 +00:00
|
|
|
elasticsearch:
|
2019-03-18 21:39:35 +00:00
|
|
|
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_ELASTICSEARCH }}
|
2020-02-26 10:47:43 +00:00
|
|
|
command: ["elasticsearch", "-Xms{{ ELASTICSEARCH_HEAP_SIZE }}", "-Xmx{{ ELASTICSEARCH_HEAP_SIZE }}", "--cluster.name=openedx", "--bootstrap.mlockall=true"]
|
2018-05-27 11:30:23 +00:00
|
|
|
ulimits:
|
|
|
|
memlock:
|
|
|
|
soft: -1
|
|
|
|
hard: -1
|
2018-10-30 08:33:11 +00:00
|
|
|
restart: unless-stopped
|
2018-05-27 11:30:23 +00:00
|
|
|
volumes:
|
2018-12-03 18:59:09 +00:00
|
|
|
- ../../data/elasticsearch:/usr/share/elasticsearch/data
|
2019-03-20 17:59:09 +00:00
|
|
|
{% endif %}
|
2018-05-27 11:30:23 +00:00
|
|
|
|
2019-01-15 08:29:27 +00:00
|
|
|
openedx-assets:
|
2019-03-18 20:53:18 +00:00
|
|
|
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX }}
|
2019-01-15 08:29:27 +00:00
|
|
|
volumes:
|
|
|
|
- ../../data/openedx:/var/www/openedx
|
2019-04-30 08:22:44 +00:00
|
|
|
command: sh -c "rm -rf /var/www/openedx/staticfiles && cp -r /openedx/staticfiles/ /var/www/openedx/"
|
2019-01-15 08:29:27 +00:00
|
|
|
|
2017-07-03 10:39:19 +00:00
|
|
|
nginx:
|
2019-03-18 21:39:35 +00:00
|
|
|
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_NGINX }}
|
2018-02-08 06:40:18 +00:00
|
|
|
restart: unless-stopped
|
2017-07-24 09:32:50 +00:00
|
|
|
ports:
|
2019-01-22 20:25:04 +00:00
|
|
|
- "{{ NGINX_HTTP_PORT }}:80"
|
|
|
|
- "{{ NGINX_HTTPS_PORT }}:443"
|
2019-06-05 13:43:51 +00:00
|
|
|
networks:
|
|
|
|
default:
|
|
|
|
aliases: [{{ patch("local-docker-compose-nginx-aliases", separator=", ") }}]
|
2017-07-03 10:39:19 +00:00
|
|
|
volumes:
|
2019-05-29 06:42:13 +00:00
|
|
|
- ../apps/nginx:/etc/nginx/conf.d/:ro
|
2018-12-03 18:59:09 +00:00
|
|
|
- ../../data/openedx:/var/www/openedx:ro
|
2019-07-07 00:52:47 +00:00
|
|
|
- ../../data/openedx-media:/var/www/openedx-media:ro
|
2019-03-22 19:15:50 +00:00
|
|
|
{% if ACTIVATE_HTTPS %}- ../../data/letsencrypt:/etc/letsencrypt/:ro{% endif %}
|
2019-07-06 22:29:33 +00:00
|
|
|
{{ patch("local-docker-compose-nginx-volumes")|indent(6) }}
|
2019-11-22 08:20:17 +00:00
|
|
|
depends_on: {{ [("lms", ACTIVATE_LMS), ("cms", ACTIVATE_CMS)]|list_if }}
|
2017-07-03 10:39:19 +00:00
|
|
|
|
2019-03-20 17:59:09 +00:00
|
|
|
{% if ACTIVATE_RABBITMQ %}
|
2017-07-24 09:32:50 +00:00
|
|
|
rabbitmq:
|
2019-03-18 21:39:35 +00:00
|
|
|
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_RABBITMQ }}
|
2017-07-24 09:32:50 +00:00
|
|
|
volumes:
|
2018-12-03 18:59:09 +00:00
|
|
|
- ../../data/rabbitmq:/var/lib/rabbitmq
|
2018-10-30 08:33:11 +00:00
|
|
|
restart: unless-stopped
|
2019-03-20 17:59:09 +00:00
|
|
|
{% endif %}
|
2017-07-24 09:32:50 +00:00
|
|
|
|
2019-03-22 16:58:41 +00:00
|
|
|
{% if ACTIVATE_SMTP %}
|
2017-07-24 09:32:50 +00:00
|
|
|
smtp:
|
2019-03-20 17:45:09 +00:00
|
|
|
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_SMTP }}
|
2018-02-08 06:40:18 +00:00
|
|
|
restart: unless-stopped
|
2019-03-22 16:58:41 +00:00
|
|
|
{% endif %}
|
2017-07-24 09:32:50 +00:00
|
|
|
|
2018-05-27 11:30:23 +00:00
|
|
|
############# Forum
|
|
|
|
|
2019-03-22 19:15:50 +00:00
|
|
|
{% if ACTIVATE_FORUM %}
|
2018-05-27 11:30:23 +00:00
|
|
|
forum:
|
2019-03-18 20:53:18 +00:00
|
|
|
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_FORUM }}
|
2019-03-20 17:57:10 +00:00
|
|
|
environment:
|
2020-03-09 12:18:02 +00:00
|
|
|
SEARCH_SERVER: "{{ ELASTICSEARCH_PROTOCOL }}://{{ ELASTICSEARCH_HOST }}:{{ ELASTICSEARCH_PORT }}"
|
2019-06-05 16:58:49 +00:00
|
|
|
MONGODB_AUTH: "{% if MONGODB_USERNAME and MONGODB_PASSWORD %}{{ MONGODB_USERNAME}}:{{ MONGODB_PASSWORD }}@{% endif %}"
|
|
|
|
MONGODB_HOST: "{{ MONGODB_HOST }}"
|
|
|
|
MONGODB_PORT: "{{ MONGODB_PORT }}"
|
2018-05-27 11:30:23 +00:00
|
|
|
restart: unless-stopped
|
2019-11-22 08:20:17 +00:00
|
|
|
depends_on: {{ [("elasticsearch", ACTIVATE_ELASTICSEARCH), ("mongodb", ACTIVATE_MONGODB)]|list_if }}
|
2019-03-22 19:15:50 +00:00
|
|
|
{% endif %}
|
2018-05-27 11:30:23 +00:00
|
|
|
|
2017-07-24 09:32:50 +00:00
|
|
|
############# LMS and CMS
|
|
|
|
|
2019-03-22 19:15:50 +00:00
|
|
|
{% if ACTIVATE_LMS %}
|
2017-07-03 10:39:19 +00:00
|
|
|
lms:
|
2019-03-18 20:53:18 +00:00
|
|
|
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX }}
|
2018-04-09 17:16:58 +00:00
|
|
|
environment:
|
|
|
|
SERVICE_VARIANT: lms
|
2019-09-19 13:39:18 +00:00
|
|
|
GUNICORN_WORKERS: {{ OPENEDX_LMS_GUNICORN_WORKERS }}
|
2019-01-20 08:23:43 +00:00
|
|
|
SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production}
|
2018-02-08 06:40:18 +00:00
|
|
|
restart: unless-stopped
|
2017-07-03 10:39:19 +00:00
|
|
|
volumes:
|
2019-01-22 20:25:04 +00:00
|
|
|
- ../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/
|
2018-12-03 18:59:09 +00:00
|
|
|
- ../../data/lms:/openedx/data
|
2019-07-07 00:52:47 +00:00
|
|
|
- ../../data/openedx-media:/openedx/media
|
2017-07-03 10:39:19 +00:00
|
|
|
depends_on:
|
2019-09-03 08:36:10 +00:00
|
|
|
- mysql
|
2019-03-20 17:59:09 +00:00
|
|
|
{% if ACTIVATE_ELASTICSEARCH %}- elasticsearch{% endif %}
|
2019-03-22 19:15:50 +00:00
|
|
|
{% if ACTIVATE_FORUM %}- forum{% endif %}
|
2019-03-20 17:59:09 +00:00
|
|
|
{% if ACTIVATE_MEMCACHED %}- memcached{% endif %}
|
|
|
|
{% if ACTIVATE_MONGODB %}- mongodb{% endif %}
|
|
|
|
{% if ACTIVATE_RABBITMQ %}- rabbitmq{% endif %}
|
2019-03-22 16:58:41 +00:00
|
|
|
{% if ACTIVATE_SMTP %}- smtp{% endif %}
|
2019-09-03 07:35:55 +00:00
|
|
|
{{ patch("local-docker-compose-lms-dependencies")|indent(6) }}
|
2019-03-22 19:15:50 +00:00
|
|
|
{% endif %}
|
2017-07-03 10:39:19 +00:00
|
|
|
|
2019-03-22 19:15:50 +00:00
|
|
|
{% if ACTIVATE_CMS %}
|
2017-07-24 09:32:50 +00:00
|
|
|
cms:
|
2019-03-18 20:53:18 +00:00
|
|
|
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX }}
|
2018-04-09 17:16:58 +00:00
|
|
|
environment:
|
|
|
|
SERVICE_VARIANT: cms
|
2019-09-19 13:39:18 +00:00
|
|
|
GUNICORN_WORKERS: {{ OPENEDX_CMS_GUNICORN_WORKERS }}
|
2019-01-20 08:23:43 +00:00
|
|
|
SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production}
|
2018-02-08 06:40:18 +00:00
|
|
|
restart: unless-stopped
|
2017-07-24 09:32:50 +00:00
|
|
|
volumes:
|
2019-01-22 20:25:04 +00:00
|
|
|
- ../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/
|
2018-12-03 18:59:09 +00:00
|
|
|
- ../../data/cms:/openedx/data
|
2019-07-07 00:52:47 +00:00
|
|
|
- ../../data/openedx-media:/openedx/media
|
2017-07-24 09:32:50 +00:00
|
|
|
depends_on:
|
2019-09-03 08:36:10 +00:00
|
|
|
- mysql
|
2019-03-20 17:59:09 +00:00
|
|
|
{% if ACTIVATE_ELASTICSEARCH %}- elasticsearch{% endif %}
|
|
|
|
{% if ACTIVATE_MEMCACHED %}- memcached{% endif %}
|
|
|
|
{% if ACTIVATE_MONGODB %}- mongodb{% endif %}
|
|
|
|
{% if ACTIVATE_RABBITMQ %}- rabbitmq{% endif %}
|
2019-03-22 16:58:41 +00:00
|
|
|
{% if ACTIVATE_SMTP %}- smtp{% endif %}
|
2019-09-03 07:35:55 +00:00
|
|
|
{{ patch("local-docker-compose-cms-dependencies")|indent(6) }}
|
2019-03-22 19:15:50 +00:00
|
|
|
{% endif %}
|
2017-07-24 09:32:50 +00:00
|
|
|
|
|
|
|
############# LMS and CMS workers
|
|
|
|
|
2019-03-22 19:15:50 +00:00
|
|
|
{% if ACTIVATE_LMS %}
|
2017-07-24 09:32:50 +00:00
|
|
|
lms_worker:
|
2019-03-18 20:53:18 +00:00
|
|
|
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX }}
|
2018-04-09 17:16:58 +00:00
|
|
|
environment:
|
|
|
|
SERVICE_VARIANT: lms
|
2019-01-20 08:23:43 +00:00
|
|
|
SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production}
|
2018-09-30 17:17:22 +00:00
|
|
|
C_FORCE_ROOT: "1" # run celery tasks as root #nofear
|
2019-05-05 11:53:04 +00:00
|
|
|
command: ./manage.py lms celery worker --loglevel=info --hostname=edx.lms.core.default.%%h --maxtasksperchild 100
|
2018-02-08 06:40:18 +00:00
|
|
|
restart: unless-stopped
|
2017-07-24 09:32:50 +00:00
|
|
|
volumes:
|
2019-01-22 20:25:04 +00:00
|
|
|
- ../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/
|
2018-12-03 18:59:09 +00:00
|
|
|
- ../../data/lms:/openedx/data
|
2019-07-07 00:52:47 +00:00
|
|
|
- ../../data/openedx-media:/openedx/media
|
2017-07-24 09:32:50 +00:00
|
|
|
depends_on:
|
2019-05-29 06:42:13 +00:00
|
|
|
- lms
|
2019-03-22 19:15:50 +00:00
|
|
|
{% endif %}
|
2017-12-26 00:16:35 +00:00
|
|
|
|
2019-03-22 19:15:50 +00:00
|
|
|
{% if ACTIVATE_CMS %}
|
2017-12-26 00:16:35 +00:00
|
|
|
cms_worker:
|
2019-03-18 20:53:18 +00:00
|
|
|
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX }}
|
2018-04-09 17:16:58 +00:00
|
|
|
environment:
|
|
|
|
SERVICE_VARIANT: cms
|
2019-01-20 08:23:43 +00:00
|
|
|
SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production}
|
2018-09-30 17:17:22 +00:00
|
|
|
C_FORCE_ROOT: "1" # run celery tasks as root #nofear
|
2019-05-05 11:53:04 +00:00
|
|
|
command: ./manage.py cms celery worker --loglevel=info --hostname=edx.cms.core.default.%%h --maxtasksperchild 100
|
2018-02-08 06:40:18 +00:00
|
|
|
restart: unless-stopped
|
2017-12-26 00:16:35 +00:00
|
|
|
volumes:
|
2019-01-22 20:25:04 +00:00
|
|
|
- ../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/
|
2018-12-03 18:59:09 +00:00
|
|
|
- ../../data/cms:/openedx/data
|
2019-07-07 00:52:47 +00:00
|
|
|
- ../../data/openedx-media:/openedx/media
|
2017-12-26 00:16:35 +00:00
|
|
|
depends_on:
|
2019-05-29 06:42:13 +00:00
|
|
|
- cms
|
2019-03-22 19:15:50 +00:00
|
|
|
{% endif %}
|
2018-12-03 18:59:09 +00:00
|
|
|
|
2019-05-29 09:14:06 +00:00
|
|
|
{{ patch("local-docker-compose-services")|indent(2) }}
|