-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (35 loc) · 1.38 KB
/
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
36
37
38
39
40
41
42
43
FROM alpine:3.11
LABEL maintainer="[email protected]"
# Fix versions of pip and setuptools
ARG PIP=20.0.1
ARG STS=41.2.0
COPY requirements.txt /app/requirements.txt
RUN apk --update --no-cache add --virtual toRemove build-base libffi-dev \
openssl-dev python3-dev \
cyrus-sasl-dev openblas-dev \
openblas-dev gfortran \
g++ gcc musl-dev lapack-dev \
&& apk --update --no-cache add libffi openssl ca-certificates python3 \
libstdc++ lapack libgcc libquadmath musl\
libgfortran cython openblas libgomp \
&& pip3 install --upgrade pip==${PIP} setuptools==${STS} \
&& pip3 install -r /app/requirements.txt \
&& apk del toRemove \
&& rm -rf /root/.cache \
&& rm -rf /var/cache/apk/* \
&& addgroup -S uwsgi && adduser -S uwsgi -G uwsgi
COPY uwsgi.ini /etc/uwsgi/conf.d/
COPY start.sh /start.sh
COPY app /app
RUN chown -R uwsgi:uwsgi /app \
&& chmod +x /start.sh \
&& mkdir -p /var/run/flask \
&& chown -R uwsgi:uwsgi /var/run/flask /etc/uwsgi/conf.d /app
ENV DEBUG 0
ENV FLASK_APP /app/main.py
ENV PYTHONPATH /app:/usr/lib/python3.8/site-packages
# Enable the next line when it goes to production
USER uwsgi
EXPOSE 5000
WORKDIR /app
ENTRYPOINT ["sh", "/start.sh"]