Last active
July 29, 2024 20:32
-
-
Save Lauriy/1141199542ad0abb128fb5cdada27f7a to your computer and use it in GitHub Desktop.
Django Dockerfile base layer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.12-slim AS base | |
LABEL maintainer="Lauri Elias <[email protected]>" | |
# So we'd never have a stuck build waiting for input | |
ARG DEBIAN_FRONTEND=noninteractive | |
# Waste of microseconds, I trust the base image to be up to date | |
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 | |
# So the very last log entry before a crash would be recorded | |
ENV PYTHONUNBUFFERED=1 | |
# To avoid writing .pyc files which may interfere during development | |
ENV PYTHONDONTWRITEBYTECODE=1 | |
WORKDIR /home/docker/rik_proovitöö | |
COPY manage.py requirements.txt ./ | |
# Buildkit style cache mount to speed up repeated builds | |
RUN --mount=type=cache,target=/root/.cache/pip pip install --no-cache-dir -r requirements.txt && rm -rf requirements.txt | |
COPY docker-entrypoint.sh /usr/bin/ | |
RUN chmod +x /usr/bin/docker-entrypoint.sh | |
# We put defaults we don't want to repeat and rarely changed files into this stage | |
ENTRYPOINT ["docker-entrypoint.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment