-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
24 lines (19 loc) · 897 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.9-alpine
WORKDIR /app
# Install Python dependencies
COPY pyproject.toml poetry.toml poetry.lock .poetry-version ./
RUN apk update && apk upgrade \
&& apk --no-cache add bash git openssh \
&& apk --no-cache add postgresql-libs \
&& apk --no-cache add --virtual .build-deps gcc postgresql-dev musl-dev \
&& pip --no-cache-dir install -U pip setuptools \
&& pip --no-cache-dir install -r .poetry-version \
&& poetry export > requirements.txt \
&& pip --no-cache-dir install -r requirements.txt \
&& apk --no-cache del .build-deps
# Install this application
COPY . .
# Collect static files ahead of time
RUN python manage.py collectstatic --noinput
# Default command
CMD [ "gunicorn", "--workers=2", "--bind=0.0.0.0:80", "--user=daemon", "--group=daemon", "--access-logfile=-", "--error-logfile=-", "downtime.wsgi" ]