-
Notifications
You must be signed in to change notification settings - Fork 543
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (22 loc) · 916 Bytes
/
Dockerfile
File metadata and controls
30 lines (22 loc) · 916 Bytes
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
FROM python:3.12-slim
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=2.0.1
RUN groupadd user && useradd --create-home --home-dir /home/user -g user user
# Install system dependencies
RUN apt-get update && apt-get install python3-dev gcc build-essential libpq-dev -y
# install python dependencies
RUN pip install "poetry==$POETRY_VERSION"
COPY pyproject.toml /home/user/app/
COPY *poetry.lock /home/user/app/
WORKDIR /home/user/app/
RUN poetry config virtualenvs.create false
RUN poetry install --with dev --no-root --no-interaction --no-ansi
WORKDIR /home/user/app/backend
COPY backend/ /home/user/app/backend
USER user
CMD gunicorn {{project_name}}.wsgi --log-file - --access-logfile - --access-logformat '%(t)s %(h)s "%(r)s" %(s)s %(b)s %(L)ss' -b 0.0.0.0:8000 --reload