From 180c295ab5ee98b76875d3e9f59f0a6016dc8214 Mon Sep 17 00:00:00 2001 From: Steven Bal Date: Mon, 31 Aug 2020 17:45:41 +0200 Subject: [PATCH] Added docs to docker build --- Dockerfile | 6 ++++++ bin/docker_start.sh | 1 + docs/conf.py | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 530561d..6d68012 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,6 +67,7 @@ FROM python:3.6-alpine AS production RUN apk --no-cache add \ ca-certificates \ mailcap \ + make \ musl \ pcre \ postgresql \ @@ -80,6 +81,7 @@ RUN apk --no-cache add \ COPY --from=build /usr/local/lib/python3.6 /usr/local/lib/python3.6 COPY --from=build /usr/local/bin/uwsgi /usr/local/bin/uwsgi +COPY --from=build /usr/local/bin/sphinx-build /usr/local/bin/sphinx-build # required for swagger2openapi conversion COPY --from=frontend-build /app/node_modules /app/node_modules @@ -91,11 +93,15 @@ RUN mkdir /app/log COPY --from=frontend-build /app/src/brc/static/fonts /app/src/brc/static/fonts COPY --from=frontend-build /app/src/brc/static/css /app/src/brc/static/css COPY ./src /app/src +COPY ./docs /app/docs ENV DJANGO_SETTINGS_MODULE=brc.conf.docker ARG SECRET_KEY=dummy +# build docs +RUN make -C docs html + # Run collectstatic, so the result is already included in the image RUN python src/manage.py collectstatic --noinput diff --git a/bin/docker_start.sh b/bin/docker_start.sh index 1bc0596..c70912b 100755 --- a/bin/docker_start.sh +++ b/bin/docker_start.sh @@ -42,6 +42,7 @@ uwsgi \ --module brc.wsgi \ --static-map /static=/app/static \ --static-map /media=/app/media \ + --static-map /_docs=/app/docs/_build/html \ --chdir src \ --processes 2 \ --threads 2 \ diff --git a/docs/conf.py b/docs/conf.py index 9270cac..518eb0c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ sys.path.insert(0, os.path.abspath('../src')) -os.environ['DJANGO_SETTINGS_MODULE'] = 'brc.conf.dev' +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'drc.conf.dev') django.setup()