mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-11-05 12:57:52 +00:00
Stop the "ln -s" settings madness
Creating soft links to files that do not exist is just madness, let's stop it. Instead, we take advantage of the CONFIG_ROOT environment variable, which allows to place lms/cms.env/auth.json files anywhere.
This commit is contained in:
parent
87980f484b
commit
e993b3109f
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user