summaryrefslogtreecommitdiffstats
path: root/Dockerfile
blob: 4cde444e6c195d697428d69b3ca116f4295bccc4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Pull base image
FROM python:3.12.3-slim-bookworm

WORKDIR /app

RUN apt-get update \
  && apt-get install -y build-essential curl \
  && rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man \
  && apt-get clean \
  && useradd --create-home python \
  && chown python:python -R /app

USER python

COPY --chown=python:python requirements*.txt ./

RUN pip install -r requirements.txt \
  && pip install -r requirements_dev.txt

COPY --chown=python:python . .

ENV DEBUG="${DEBUG}" \
    PYTHONUNBUFFERED="true" \
    PATH="${PATH}:/home/python/.local/bin" \
    USER="python"

# Collect static files
RUN SECRET_KEY=nothing python manage.py collectstatic --no-input

CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]