2023-07-11 21:29:54 +00:00
|
|
|
FROM python:3.11.4-slim-bookworm
|
2016-09-29 20:20:10 +00:00
|
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
RUN mkdir /code
|
|
|
|
WORKDIR /code
|
2023-07-11 21:29:54 +00:00
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
2024-01-14 12:53:39 +00:00
|
|
|
libpq-dev \
|
|
|
|
gcc \
|
2023-07-11 21:29:54 +00:00
|
|
|
&& \
|
2024-01-14 12:53:39 +00:00
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2016-09-29 20:20:10 +00:00
|
|
|
ADD requirements.txt /code/
|
2017-12-13 19:02:16 +00:00
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
2016-09-29 20:20:10 +00:00
|
|
|
ADD . /code/
|
2019-05-12 13:58:19 +00:00
|
|
|
|
2023-07-11 21:29:54 +00:00
|
|
|
RUN python -m pip install gunicorn
|
|
|
|
|
2023-07-17 21:09:11 +00:00
|
|
|
RUN python manage.py collectstatic --no-input --clear
|
2024-01-14 12:53:39 +00:00
|
|
|
CMD bash -c "python manage.py migrate && gunicorn --workers 1 --threads 4 -b 0.0.0.0:8000 --capture-output --error-logfile - --access-logfile - spejstore.wsgi:application"
|