-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
35 lines (25 loc) · 924 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
25
26
27
28
29
30
31
32
33
34
35
FROM python:3.8.2-alpine as base
MAINTAINER Andres Morey "andresmarcel@gmail.com"
# -----------------------------------------------------------------------------
FROM base as builder
# system dependencies
RUN apk update \
&& apk add --no-cache --virtual build-dependencies gcc libffi-dev libxml2-dev musl-dev make \
&& apk add --no-cache libxslt-dev \
&& apk add --no-cache bash
# python dependencies
COPY requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
# cleanup /usr/lib
RUN apk del build-dependencies
# -----------------------------------------------------------------------------
FROM base
# copy dependencies
COPY --from=builder /usr/lib /usr/lib
COPY --from=builder /usr/local /usr/local
# copy source
COPY . /app
WORKDIR /app
# entrypoint
ENTRYPOINT ["gunicorn", "wsgi:app"]
CMD ["--bind=0.0.0.0:5000", "--worker-class=gevent", "--workers=4", "--threads=1", "--preload"]