From ce95ed4854ebb2afe1b9da7169af7b1795350b1d Mon Sep 17 00:00:00 2001 From: pi-ux-ce Date: Tue, 2 Dec 2025 00:00:40 +0000 Subject: [PATCH] try new dockerfile --- dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dockerfile b/dockerfile index 978c67d..6fedd65 100644 --- a/dockerfile +++ b/dockerfile @@ -1,17 +1,17 @@ -FROM python:3 +FROM python:3.11-slim ENV PYTHONUNBUFFERED 1 WORKDIR /code/ +# Copy only the requirements file first (Changes infrequently) COPY requirements.txt ./ -COPY django_code ./ +# Install dependencies. This layer is highly cacheable by BuildKit + GHA setup. +RUN pip install --no-cache-dir -r requirements.txt +# Copy the rest of your application code (Changes frequently, invalidates subsequent cache) +COPY . ./ -RUN --mount=type=cache,target=/root/.cache/pip pip install --upgrade pip -RUN --mount=type=cache,target=/root/.cache/pip pip install --no-cache-dir -r requirements.txt -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" ]