Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY docs src
RUN mdbook build


FROM python:3.11.3-bullseye
FROM python:3.11.3-bullseye AS template
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
WORKDIR /code
Expand All @@ -16,10 +16,6 @@ RUN apt-get update && \
libproj-dev \
gdal-bin \
libsqlite3-mod-spatialite \
# Database client for using './manage.py dbshell' etc
#sqlite3 \
#spatialite-bin \
#postgresql-client \
&& \
apt-get -y autoremove && \
apt-get -y clean && \
Expand All @@ -31,10 +27,32 @@ VOLUME /static
VOLUME /media
VOLUME /docs
COPY . .
COPY --from=docs /book/book /built_docs

EXPOSE 8000

HEALTHCHECK --interval=10s --timeout=5s --retries=5 CMD bash -c '[[ "$(curl -L -o /dev/null -s -w "%{http_code}\n" http://localhost:8000/)" == "200" ]]'

ENTRYPOINT ["/code/docker-entrypoint.sh"]


FROM template AS dev_template
RUN apt-get update && \
apt-get install -y \
# Database client for using './manage.py dbshell' etc
sqlite3 \
spatialite-bin \
postgresql-client \
&& \
apt-get -y autoremove && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*


FROM dev_template AS dev
COPY . .
COPY --from=docs /book/book /built_docs


FROM template AS prod
COPY . .
COPY --from=docs /book/book /built_docs
40 changes: 0 additions & 40 deletions django/Dockerfile.dev

This file was deleted.