6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2025-01-24 14:08:23 +00:00
tutor/configurator/Dockerfile
Régis Behmo ea2dd7c4fb Generate configuration from Docker
We no longer run the `configure` script on the host. Instead, we run a
container that generates the configuration files. This opens the way for
more complex configuration templates that would be written in jinja2.
More complex templates are required for feature flags, such as SSL,
XQUEUE, etc.
2018-08-16 14:42:10 +02:00

26 lines
1.4 KiB
Docker

FROM ubuntu:18.04
RUN apt update && \
apt install -y python3 python3-pip
RUN pip3 install jinja2
RUN mkdir /openedx
VOLUME /openedx/config
COPY ./bin/configure.py /openedx/configure.py
COPY ./bin/docker-entrypoint.sh /openedx/docker-entrypoint.sh
WORKDIR /openedx
ENV SILENT=''
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ./configure.py interactive ${SILENT:+--silent} && \
./configure.py substitute ./config/openedx/templates/lms.env.json.templ ./config/openedx/lms.env.json && \
./configure.py substitute ./config/openedx/templates/cms.env.json.templ ./config/openedx/cms.env.json && \
./configure.py substitute ./config/openedx/templates/lms.auth.json.templ ./config/openedx/lms.auth.json && \
./configure.py substitute ./config/openedx/templates/cms.auth.json.templ ./config/openedx/cms.auth.json && \
./configure.py substitute ./config/openedx/templates/provision.sh.templ ./config/openedx/provision.sh && \
./configure.py substitute ./config/xqueue/templates/universal.py.templ ./config/xqueue/universal.py && \
./configure.py substitute ./config/mysql/templates/auth.env.templ ./config/mysql/auth.env && \
./configure.py substitute --delimiter '£' ./config/nginx/templates/lms.conf.templ ./config/nginx/lms.conf && \
./configure.py substitute --delimiter '£' ./config/nginx/templates/cms.conf.templ ./config/nginx/cms.conf && \
./configure.py substitute ./config/android/templates/universal.yaml.templ ./config/android/universal.yaml