7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-26 16:53:28 +00:00
tutor/tutor/templates/local/docker-compose.yml

197 lines
6.6 KiB
YAML
Raw Normal View History

2017-07-03 10:39:19 +00:00
version: "3"
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
{% if ACTIVATE_MYSQL %}
2017-07-03 10:39:19 +00:00
mysql:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_MYSQL }}
2017-07-03 10:39:19 +00:00
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci
restart: unless-stopped
2017-07-03 10:39:19 +00:00
volumes:
- ../../data/mysql:/var/lib/mysql
env_file: ../apps/mysql/auth.env
{% endif %}
mysql-client:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_MYSQL }}
entrypoint: ["sh", "-e", "-c"]
command: ["echo 'ready'; while true; do sleep 60; done"]
restart: unless-stopped
{% if ACTIVATE_MYSQL%}depends_on:
- mysql{% endif %}
2017-07-03 10:39:19 +00:00
{% if ACTIVATE_ELASTICSEARCH %}
elasticsearch:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_ELASTICSEARCH }}
environment:
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
- "cluster.name=openedx"
- "bootstrap.memory_lock=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:
{% if ACTIVATE_LMS %}- lms{% endif %}
{% if ACTIVATE_CMS %}- cms {% endif %}
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: "http://{{ 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:
{% if ACTIVATE_ELASTICSEARCH %}- elasticsearch{% endif %}
{% if ACTIVATE_MONGODB %}- mongodb{% endif %}
{% 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
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:
{% if ACTIVATE_ELASTICSEARCH %}- elasticsearch{% endif %}
{% if ACTIVATE_FORUM %}- forum{% endif %}
{% if ACTIVATE_MEMCACHED %}- memcached{% endif %}
{% if ACTIVATE_MONGODB %}- mongodb{% endif %}
{% if ACTIVATE_MYSQL %}- mysql{% endif %}
{% if ACTIVATE_RABBITMQ %}- rabbitmq{% endif %}
{% if ACTIVATE_SMTP %}- smtp{% endif %}
{% endif %}
2017-07-03 10:39:19 +00:00
{% if ACTIVATE_CMS %}
cms:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX }}
environment:
SERVICE_VARIANT: cms
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:
{% if ACTIVATE_ELASTICSEARCH %}- elasticsearch{% endif %}
{% if ACTIVATE_MEMCACHED %}- memcached{% endif %}
{% if ACTIVATE_MONGODB %}- mongodb{% endif %}
{% if ACTIVATE_MYSQL %}- mysql{% endif %}
{% if ACTIVATE_RABBITMQ %}- rabbitmq{% endif %}
{% if ACTIVATE_SMTP %}- smtp{% endif %}
{% 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) }}