Files
Django_kube/dockerfile
T
pierre geeraert 15e28502c1
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
collectstatic all the time
2026-07-05 13:54:52 +01:00

31 lines
918 B
Docker

FROM python:3.12
ENV PYTHONUNBUFFERED 1
#ENV ALLOWED_HOSTS 'django.tryton.geeraert.eu'
#ENV DEBUG 'True'
ARG ALLOWED_HOSTS
ARG DEBUG
ENV ALLOWED_HOSTS=$ALLOWED_HOSTS
ENV DEBUG=$DEBUG
WORKDIR /code/
# Copy only the requirements file first (Changes infrequently)
COPY requirements.txt ./
RUN pip install --cache-dir=/opt/hostedtoolcache/pip --upgrade pip
RUN pip list --cache-dir=/opt/hostedtoolcache/pip --outdated
RUN pip install --cache-dir=/opt/hostedtoolcache/pip --upgrade wheel
RUN pip install --cache-dir=/opt/hostedtoolcache/pip --upgrade setuptools
RUN pip install --cache-dir=/opt/hostedtoolcache/pip -r requirements.txt
# Copy the rest of your application code (Changes frequently, invalidates subsequent cache)
COPY . ./
RUN python django_code/manage.py collectstatic --noinput
# CMD is the command run when the container starts
CMD [ "python","django_code/manage.py","runserver","0.0.0.0:8000" ]