22 lines
630 B
Docker
22 lines
630 B
Docker
FROM python:3.11-slim
|
|
|
|
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 pip install --upgrade pip
|
|
RUN pip list --outdated
|
|
RUN pip install --upgrade wheel
|
|
RUN pip install --upgrade setuptools
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy the rest of your application code (Changes frequently, invalidates subsequent cache)
|
|
COPY . ./
|
|
|
|
# CMD is the command run when the container starts
|
|
CMD [ "python","django_code/manage.py","runserver","0.0.0.0:8000" ]
|