ticket-website/Dockerfile
2024-03-06 16:02:27 +00:00

27 lines
549 B
Docker

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