##### Important information for maintaining this Dockerfile ######################################## # Read the docs/topics/development/docker.md file for more information about this Dockerfile. #################################################################################################### FROM python:3.11-slim-bookworm AS olympia # Set shell to bash with logs and errors for build SHELL ["/bin/bash", "-xue", "-c"] ENV OLYMPIA_UID=9500 RUN < settings_local.py DJANGO_SETTINGS_MODULE="settings_local" make -f Makefile-docker update_assets EOF FROM base AS sources ARG DOCKER_BUILD DOCKER_COMMIT DOCKER_VERSION ENV DOCKER_BUILD=${DOCKER_BUILD} ENV DOCKER_COMMIT=${DOCKER_COMMIT} ENV DOCKER_VERSION=${DOCKER_VERSION} # Add our custom mime types (required for for ts/json/md files) COPY docker/etc/mime.types /etc/mime.types # Copy the rest of the source files from the host COPY --chown=olympia:olympia . ${HOME} # Copy assets from assets COPY --from=assets --chown=olympia:olympia ${HOME}/site-static ${HOME}/site-static COPY --from=assets --chown=olympia:olympia ${HOME}/static-build ${HOME}/static-build # Set shell back to sh until we can prove we can use bash at runtime SHELL ["/bin/sh", "-c"] FROM sources AS development # Copy dependencies from `pip_development` COPY --from=pip_development --chown=olympia:olympia /deps /deps FROM sources AS production # Copy compiled locales from builder COPY --from=locales --chown=olympia:olympia ${HOME}/locale ${HOME}/locale # Copy dependencies from `pip_production` COPY --from=pip_production --chown=olympia:olympia /deps /deps