Files
Django_kube/dockerfile
T
pi-ux-ce 85962b11a6
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 5m45s
adding some cache for PIP
2025-12-02 10:47:20 +00:00

23 lines
912 B
Docker

FROM gitea.tryton.geeraert.eu/pi-ux-ce/python:3
ENV PYTHONUNBUFFERED 1
WORKDIR /code/
# Copy only the requirements file first (Changes infrequently)
COPY requirements.txt ./
# Install dependencies. This layer is highly cacheable by BuildKit + GHA setup.
RUN --mount=type=cache,target=/root/.cache/pip pip install --upgrade pip
RUN --mount=type=cache,target=/root/.cache/pip pip list --outdated
RUN --mount=type=cache,target=/root/.cache/pip pip install --upgrade wheel
RUN --mount=type=cache,target=/root/.cache/pip pip install --upgrade setuptools
RUN --mount=type=cache,target=/root/.cache/pip pip install --no-cache-dir -r requirements.txt
# Copy the rest of your application code (Changes frequently, invalidates subsequent cache)
COPY . ./
RUN python django_code/manage.py migrate
# CMD is the command run when the container starts
CMD [ "python","django_code/manage.py","runserver","0.0.0.0:8000" ]