-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile.alpine
More file actions
42 lines (29 loc) · 1.04 KB
/
Containerfile.alpine
File metadata and controls
42 lines (29 loc) · 1.04 KB
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
# Containerfile for the Flask image tool
FROM python:3.8-alpine AS base
USER root
ENV ENV=/etc/profile \
HOME=/root
COPY config/motd /etc/motd
RUN echo "cat /etc/motd" > /etc/profile.d/motd.sh
FROM base AS app
USER root
ENV FLASK_APP=app.py \
FLASK_ENV=development \
FLASK_DIR=/opt \
HOST=0.0.0.0 \
PORT=5000
ENV UPLOAD_FOLDER=${FLASK_DIR}/storage
EXPOSE ${PORT}
WORKDIR ${FLASK_DIR}
RUN mkdir -vp ${UPLOAD_FOLDER} && \
chmod -c a+rx,ug+ws,o-w ${UPLOAD_FOLDER} && \
chown -cR root:root ${UPLOAD_FOLDER}
COPY requirements.txt ${FLASK_DIR}
COPY app.py ${FLASK_DIR}
COPY static/ ${FLASK_DIR}/static/
COPY templates/ ${FLASK_DIR}/templates/
COPY config/awscli ${HOME}/.aws/config
RUN pip config --global set global.progress_bar off && \
pip install --requirement requirements.txt
# CMD flask run --host=${HOST} --port ${PORT} --reload --no-debugger --eager-loading --with-threads
CMD gunicorn app:app --bind ${HOST}:${PORT} --reload --preload --capture-output --log-level info --access-logfile - --error-logfile -