6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-11-10 15:20:56 +00:00
tutor/tutor/templates/local/docker-compose.yml

190 lines
6.7 KiB
YAML
Raw Normal View History

version: "3.7"
2017-07-03 10:39:19 +00:00
services:
############# External services
{% if ACTIVATE_MEMCACHED %}
2017-07-03 10:39:19 +00:00
memcached:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_MEMCACHED }}
restart: unless-stopped
{% endif %}
2017-07-03 10:39:19 +00:00
{% if ACTIVATE_MONGODB %}
2017-07-03 10:39:19 +00:00
mongodb:
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
restart: unless-stopped
2017-07-03 10:39:19 +00:00
volumes:
- ../../data/mongodb:/data/db
{% endif %}
2017-07-03 10:39:19 +00:00
mysql:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_MYSQL }}
{% if ACTIVATE_MYSQL %}
2017-07-03 10:39:19 +00:00
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci
{% else %}
entrypoint: ["sh", "-e", "-c"]
command: ["echo 'ready'; while true; do sleep 60; done"]
{% endif %}
restart: unless-stopped
2017-07-03 10:39:19 +00:00
volumes:
- ../../data/mysql:/var/lib/mysql
env_file: ../apps/mysql/auth.env
2017-07-03 10:39:19 +00:00
{% 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 %}
openedx-assets:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX }}
volumes:
- ../../data/openedx:/var/www/openedx
command: sh -c "rm -rf /var/www/openedx/staticfiles && cp -r /openedx/staticfiles/ /var/www/openedx/"
2017-07-03 10:39:19 +00:00
nginx:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_NGINX }}
restart: unless-stopped
ports:
- "{{ NGINX_HTTP_PORT }}:80"
- "{{ NGINX_HTTPS_PORT }}:443"
networks:
default:
aliases: [{{ patch("local-docker-compose-nginx-aliases", separator=", ") }}]
2017-07-03 10:39:19 +00:00
volumes:
- ../apps/nginx:/etc/nginx/conf.d/:ro
- ../../data/openedx:/var/www/openedx:ro
- ../../data/openedx-media:/var/www/openedx-media:ro
{% if ACTIVATE_HTTPS %}- ../../data/letsencrypt:/etc/letsencrypt/:ro{% endif %}
{{ patch("local-docker-compose-nginx-volumes")|indent(6) }}
depends_on: {{ [("lms", ACTIVATE_LMS), ("cms", ACTIVATE_CMS)]|list_if }}
2017-07-03 10:39:19 +00:00
{% 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_PROTOCOL }}://{{ 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 %}
2017-07-03 10:39:19 +00:00
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
2017-07-03 10:39:19 +00:00
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
2017-07-03 10:39:19 +00:00
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 %}
2017-07-03 10:39:19 +00:00
{% 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 %}
{{ 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 %}
2017-12-26 00:16:35 +00:00
{% if ACTIVATE_CMS %}
2017-12-26 00:16:35 +00:00
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
restart: unless-stopped
2017-12-26 00:16:35 +00:00
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
2017-12-26 00:16:35 +00:00
depends_on:
- cms
{% endif %}
{{ patch("local-docker-compose-services")|indent(2) }}