try new dockerfile
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
2025-12-02 00:00:40 +00:00
parent 3bf2d553c8
commit ce95ed4854
+7 -7
View File
@@ -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" ]