Update Dockerfile

This commit is contained in:
Corban-Lee Jones 2024-03-06 16:02:27 +00:00
parent 75531f872b
commit 92c6cda583

View File

@ -1,18 +1,27 @@
FROM python:3.9 FROM python:3.12
# set environment variables # set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV DJANGO_SETTINGS_MODULE core.settings
WORKDIR /website
COPY requirements.txt .
# install python dependencies # install python dependencies
COPY requirements.txt .
RUN pip install --upgrade pip RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
COPY . . COPY . /website/
# running migrations # collect static files
RUN python manage.py collectstatic --noinput
# run migrations
RUN python manage.py migrate RUN python manage.py migrate
# Port that the site runs on
EXPOSE 4411
# gunicorn # gunicorn
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "core.wsgi"] CMD ["gunicorn", "core.wsgi:application", "--bind", "0.0.0.0:4411"]