diff --git a/build/notes/Dockerfile b/build/notes/Dockerfile index 31eb979..1f633c9 100644 --- a/build/notes/Dockerfile +++ b/build/notes/Dockerfile @@ -10,8 +10,5 @@ WORKDIR /openedx/edx-notes-api RUN pip install -r requirements/base.txt -ENV DJANGO_SETTINGS_MODULE notesserver.settings.tutor -RUN ln -s /openedx/config/tutor.py notesserver/settings/tutor.py - EXPOSE 8000 CMD gunicorn --name notes --bind=0.0.0.0:8000 --max-requests=1000 notesserver.wsgi:application diff --git a/build/openedx/Dockerfile b/build/openedx/Dockerfile index 1608fc9..f9fb40f 100644 --- a/build/openedx/Dockerfile +++ b/build/openedx/Dockerfile @@ -59,18 +59,12 @@ COPY ./requirements/ /openedx/requirements RUN touch /openedx/requirements/private.txt \ && pip install -r /openedx/requirements/private.txt -# Link configuration files to common /openedx/config folder, which should later -# be mounted as a volume. Note that this image will not be functional until -# config files have been mounted inside the container -RUN mkdir -p /openedx/env/tutor/lms /openedx/env/tutor/cms \ - && ln -s /openedx/env/tutor/lms/ /openedx/edx-platform/lms/envs/tutor \ - && ln -s /openedx/env/tutor/cms/ /openedx/edx-platform/cms/envs/tutor \ - && ln -s /openedx/env/lms.env.json /openedx/ \ - && ln -s /openedx/env/cms.env.json /openedx/ \ - && ln -s /openedx/env/lms.auth.json /openedx/ \ - && ln -s /openedx/env/cms.auth.json /openedx/ -COPY settings/lms/*.py /openedx/env/tutor/lms/ -COPY settings/cms/*.py /openedx/env/tutor/cms/ +# Create folder that will store *.env.json and *.auth.json files, as well as +# the tutor-specific settings files. +RUN mkdir -p /openedx/config ./lms/envs/tutor ./cms/envs/tutor +ENV CONFIG_ROOT /openedx/config +COPY settings/lms/*.py ./lms/envs/tutor/ +COPY settings/cms/*.py ./cms/envs/tutor/ # Copy scripts COPY ./bin /openedx/bin diff --git a/build/xqueue/Dockerfile b/build/xqueue/Dockerfile index 840e6c1..dbaf47f 100644 --- a/build/xqueue/Dockerfile +++ b/build/xqueue/Dockerfile @@ -10,8 +10,5 @@ WORKDIR /openedx/xqueue RUN pip install -r requirements.txt -ENV DJANGO_SETTINGS_MODULE xqueue.tutor -RUN ln -s /openedx/config/tutor.py xqueue/tutor.py - EXPOSE 8040 CMD gunicorn --name xqueue --bind=0.0.0.0:8040 --max-requests=1000 xqueue.wsgi:application diff --git a/deploy/singleserver/Makefile b/deploy/singleserver/Makefile index 589894b..533a191 100644 --- a/deploy/singleserver/Makefile +++ b/deploy/singleserver/Makefile @@ -59,9 +59,9 @@ env: databases: provision-databases migrate provision-oauth2 ## Bootstrap databases provision-databases: ## Create necessary databases and users - $(DOCKER_COMPOSE_RUN) lms /openedx/env/provision.sh + $(DOCKER_COMPOSE_RUN) -v $(PWD)/../env/openedx/scripts:/openedx/scripts lms /openedx/scripts/provision.sh provision-oauth2: ## Create users for SSO between services - $(DOCKER_COMPOSE_RUN) lms /openedx/env/oauth2.sh + $(DOCKER_COMPOSE_RUN) -v $(PWD)/../env/openedx/scripts:/openedx/scripts lms /openedx/scripts/oauth2.sh migrate: migrate-openedx migrate-forum ## Perform all database migrations @if [ "$(ACTIVATE_XQUEUE)" = "1" ] ; then \ @@ -156,8 +156,8 @@ https-certificate-renew: ## Renew https certificates stats: ## Collect anonymous information about the platform @if [ "$(DISABLE_STATS)" != "1" ] ; then \ - docker run --rm -it --volume="$(PWD)/../env:/openedx/env" \ - regis/openedx-configurator:hawthorn /openedx/env/openedx/stats 2> /dev/null || true ; \ + docker run --rm -it --volume="$(PWD)/../env/openedx/scripts:/openedx/scripts" \ + regis/openedx-configurator:hawthorn /openedx/scripts/stats 2> /dev/null || true ; \ fi import-demo-course: ## Import the demo course from edX diff --git a/deploy/singleserver/templates/docker-compose.yml b/deploy/singleserver/templates/docker-compose.yml index e4f108d..f4539b3 100644 --- a/deploy/singleserver/templates/docker-compose.yml +++ b/deploy/singleserver/templates/docker-compose.yml @@ -80,7 +80,9 @@ services: SERVICE_VARIANT: lms restart: unless-stopped volumes: - - ../env/openedx:/openedx/env + - ../env/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/ + - ../env/openedx/settings/cms/:/openedx/edx-platform/cms/envs/tutor/ + - ../env/openedx/config/:/openedx/config/ - ../../data/lms:/openedx/data depends_on: - elasticsearch @@ -97,7 +99,9 @@ services: SERVICE_VARIANT: cms restart: unless-stopped volumes: - - ../env/openedx:/openedx/env + - ../env/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/ + - ../env/openedx/settings/cms/:/openedx/edx-platform/cms/envs/tutor/ + - ../env/openedx/config/:/openedx/config/ - ../../data/cms:/openedx/data depends_on: - memcached @@ -117,7 +121,9 @@ services: command: ./manage.py lms celery worker --loglevel=info --hostname=edx.lms.core.default.%%h --maxtasksperchild 100 restart: unless-stopped volumes: - - ../env/openedx:/openedx/env + - ../env/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/ + - ../env/openedx/settings/cms/:/openedx/edx-platform/cms/envs/tutor/ + - ../env/openedx/config/:/openedx/config/ - ../../data/lms:/openedx/data depends_on: - lms @@ -130,7 +136,9 @@ services: command: ./manage.py cms celery worker --loglevel=info --hostname=edx.cms.core.default.%%h --maxtasksperchild 100 restart: unless-stopped volumes: - - ../env/openedx:/openedx/env + - ../env/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/ + - ../env/openedx/settings/cms/:/openedx/edx-platform/cms/envs/tutor/ + - ../env/openedx/config/:/openedx/config/ - ../../data/cms:/openedx/data depends_on: - cms @@ -143,8 +151,10 @@ services: default: aliases: - notes.openedx + environment: + DJANGO_SETTINGS_MODULE: notesserver.settings.tutor volumes: - - ../env/notes:/openedx/env + - ../env/notes/tutor.py:/openedx/edx-notes-api/notesserver/settings/tutor.py - ../../data/notes:/openedx/data restart: unless-stopped depends_on: @@ -156,8 +166,10 @@ services: xqueue: image: regis/openedx-xqueue:hawthorn volumes: - - ../env/xqueue:/openedx/env + - ../env/xqueue/tutor.py:/openedx/xqueue/xqueue/tutor.py - ../../data/xqueue:/openedx/data + environment: + DJANGO_SETTINGS_MODULE: xqueue.tutor restart: unless-stopped depends_on: - mysql @@ -165,8 +177,10 @@ services: xqueue_consumer: image: regis/openedx-xqueue:hawthorn volumes: - - ../env/xqueue:/openedx/env + - ../env/xqueue/tutor.py:/openedx/xqueue/xqueue/tutor.py - ../../data/xqueue:/openedx/data + environment: + DJANGO_SETTINGS_MODULE: xqueue.tutor restart: unless-stopped # Run 12 workers per queue command: ./manage.py run_consumer 12 diff --git a/deploy/templates/openedx/cms.auth.json b/deploy/templates/openedx/config/cms.auth.json similarity index 100% rename from deploy/templates/openedx/cms.auth.json rename to deploy/templates/openedx/config/cms.auth.json diff --git a/deploy/templates/openedx/cms.env.json b/deploy/templates/openedx/config/cms.env.json similarity index 100% rename from deploy/templates/openedx/cms.env.json rename to deploy/templates/openedx/config/cms.env.json diff --git a/deploy/templates/openedx/lms.auth.json b/deploy/templates/openedx/config/lms.auth.json similarity index 100% rename from deploy/templates/openedx/lms.auth.json rename to deploy/templates/openedx/config/lms.auth.json diff --git a/deploy/templates/openedx/lms.env.json b/deploy/templates/openedx/config/lms.env.json similarity index 100% rename from deploy/templates/openedx/lms.env.json rename to deploy/templates/openedx/config/lms.env.json diff --git a/deploy/templates/openedx/oauth2.sh b/deploy/templates/openedx/scripts/oauth2.sh similarity index 100% rename from deploy/templates/openedx/oauth2.sh rename to deploy/templates/openedx/scripts/oauth2.sh diff --git a/deploy/templates/openedx/provision.sh b/deploy/templates/openedx/scripts/provision.sh similarity index 100% rename from deploy/templates/openedx/provision.sh rename to deploy/templates/openedx/scripts/provision.sh diff --git a/deploy/templates/openedx/stats b/deploy/templates/openedx/scripts/stats similarity index 100% rename from deploy/templates/openedx/stats rename to deploy/templates/openedx/scripts/stats diff --git a/deploy/templates/openedx/tutor/cms/__init__.py b/deploy/templates/openedx/settings/cms/__init__.py similarity index 100% rename from deploy/templates/openedx/tutor/cms/__init__.py rename to deploy/templates/openedx/settings/cms/__init__.py diff --git a/deploy/templates/openedx/tutor/cms/development.py b/deploy/templates/openedx/settings/cms/development.py similarity index 100% rename from deploy/templates/openedx/tutor/cms/development.py rename to deploy/templates/openedx/settings/cms/development.py diff --git a/deploy/templates/openedx/tutor/cms/production.py b/deploy/templates/openedx/settings/cms/production.py similarity index 100% rename from deploy/templates/openedx/tutor/cms/production.py rename to deploy/templates/openedx/settings/cms/production.py diff --git a/deploy/templates/openedx/tutor/lms/__init__.py b/deploy/templates/openedx/settings/lms/__init__.py similarity index 100% rename from deploy/templates/openedx/tutor/lms/__init__.py rename to deploy/templates/openedx/settings/lms/__init__.py diff --git a/deploy/templates/openedx/tutor/lms/development.py b/deploy/templates/openedx/settings/lms/development.py similarity index 100% rename from deploy/templates/openedx/tutor/lms/development.py rename to deploy/templates/openedx/settings/lms/development.py diff --git a/deploy/templates/openedx/tutor/lms/production.py b/deploy/templates/openedx/settings/lms/production.py similarity index 100% rename from deploy/templates/openedx/tutor/lms/production.py rename to deploy/templates/openedx/settings/lms/production.py