1
0
Fork 0
spejstore-new/Dockerfile

19 lines
675 B
Docker
Raw Permalink Normal View History

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
RUN groupadd --gid 1000 spejstore && useradd --uid 1000 --gid 1000 --home /code --shell /bin/bash spejstore
USER spejstore
2023-07-11 21:29:54 +00:00
2024-01-14 22:56:26 +00:00
CMD bash -c "python manage.py collectstatic --no-input --clear && python manage.py migrate && gunicorn --workers 1 --threads 4 -b 0.0.0.0:8000 --capture-output --error-logfile - --access-logfile - spejstore.wsgi:application"