Skip to content

Commit

Permalink
Added docs to docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Sep 7, 2020
1 parent 5b29cf0 commit 180c295
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ FROM python:3.6-alpine AS production
RUN apk --no-cache add \
ca-certificates \
mailcap \
make \
musl \
pcre \
postgresql \
Expand All @@ -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

Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions bin/docker_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 180c295

Please sign in to comment.