This commit is contained in:
+7
-7
@@ -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" ]
|
||||
|
||||
Reference in New Issue
Block a user