-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (17 loc) · 710 Bytes
/
Dockerfile
File metadata and controls
29 lines (17 loc) · 710 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
# this allows dockerfile to *know* about build arguments
FROM python:3.11.6-alpine as production
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN apk update && \
apk add postgresql-libs && \
apk add --virtual .build-deps build-base musl-dev postgresql-dev libffi-dev python3-dev cargo
RUN apk add --no-cache postgresql-client curl
COPY . /mainapps
WORKDIR /mainapps
RUN pip install --upgrade pip && \
pip install poetry
RUN poetry export --output requirements.txt
RUN pip install -r requirements.txt
RUN python manage.py collectstatic --noinput
CMD sh ./scripts/wait-and-setup-for-postgres.sh && python manage.py migrate && gunicorn --bind :8001 --workers 3 mainapps.wsgi
EXPOSE 8001