-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (31 loc) · 1.02 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
# ============================= BASE =============================
# Get official base image
FROM python:3.8.2-slim-buster AS base
# Set the working directory. Note, this must be done prior to adding the user as chown will fail on no such directory.
WORKDIR /app
# Add a user
RUN useradd -m app
RUN chown -R app:app /app
ENV PATH="/home/app/.local/bin:${PATH}"
USER app
# Get the dependencies
COPY requirements.txt requirements.txt
RUN pip install --user --upgrade pip
RUN pip install --user -r requirements.txt
RUN pip install --user gunicorn
# Setup the environment
COPY static static
COPY templates templates
COPY app.py boot.sh ./
ENV FLASK_APP app.py
# # ========================= DEVELOPMENT ==========================
# FROM base AS development
# EXPOSE 5007
# CMD [ "flask", "run" ]
# ========================= PRODUCTION ===========================
FROM base AS production
EXPOSE 80
ENTRYPOINT ["/bin/bash", "./boot.sh"]
# # =========================== MANAGE =============================
# FROM base AS manage
# ENTRYPOINT [ "flask" ]