-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
33 lines (23 loc) · 801 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
FROM python:slim AS builder
COPY Makefile /app/
RUN apt update -yq \
&& apt install -yq bzip2 cmake g++ make wget \
&& pip wheel -w /app/ dlib \
&& make -C /app/ download-models
FROM python:slim
COPY --from=builder /app/dlib*.whl /tmp/
COPY --from=builder /app/vendor/ /app/vendor/
RUN pip install flask numpy gunicorn \
&& pip install --no-index -f /tmp/ dlib \
&& rm /tmp/dlib*.whl
COPY facerecognition-external-model.py /app/
COPY gunicorn_config.py /app/
WORKDIR /app/
EXPOSE 5000
ARG GUNICORN_WORKERS="1" \
PORT="5000"
ENV GUNICORN_WORKERS="${GUNICORN_WORKERS}"\
PORT="${PORT}"\
API_KEY=some-super-secret-api-key\
FLASK_APP=facerecognition-external-model.py
ENTRYPOINT ["gunicorn" , "-c", "gunicorn_config.py", "facerecognition-external-model:app"]