-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.flask
More file actions
34 lines (24 loc) · 880 Bytes
/
Dockerfile.flask
File metadata and controls
34 lines (24 loc) · 880 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
30
31
32
33
34
FROM python:3
###############################
# 1. Install packages as root #
###############################
RUN python3 -m pip install --no-cache-dir gunicorn[gevent]
COPY . /source
RUN python3 -m pip install --no-cache-dir /source
######################
# 2. Configure paths #
######################
ENV INSTANCE_PATH /instance
VOLUME ${INSTANCE_PATH}
###########################################################
# 3. Create an unprivileged user that will run the server #
###########################################################
RUN useradd --create-home user
RUN mkdir -p ${INSTANCE_PATH} && chown user:user ${INSTANCE_PATH}
USER user
###########################
# 4. Configure the server #
###########################
ENV FLASK_APP cortical_voluba
EXPOSE 8080
CMD gunicorn --access-logfile=- 'cortical_voluba.wsgi:application' --bind=:8080 --worker-class=gevent