-
Notifications
You must be signed in to change notification settings - Fork 0
/
Containerfile.ubi8
42 lines (29 loc) · 1.08 KB
/
Containerfile.ubi8
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 registry.access.redhat.com/ubi8/python-38 AS base
USER root
COPY config/motd /etc/motd
RUN echo "cat /etc/motd" >> /opt/app-root/src/.bashrc
FROM base AS app
USER root
ENV FLASK_APP=app.py \
FLASK_ENV=development \
FLASK_DIR=${HOME} \
HOST=0.0.0.0 \
PORT=5000 \
UPLOAD_FOLDER=/var/storage
EXPOSE ${PORT}
WORKDIR ${FLASK_DIR}
RUN mkdir -vp ${UPLOAD_FOLDER} && \
chmod -c a+rx,ug+ws,o-w ${UPLOAD_FOLDER} && \
chown -cR default: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 && \
chown -R default:root ${HOME}
USER default
# 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 -