Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#Each command creates a separate layer

#Base subsquent layers on alpine:3.8
FROM alpine:3.8

#Create the /opt and /opt/app directories
RUN mkdir /opt && mkdir /opt/app

#Install python 3 and pip
RUN apk add --no-cache python3 py-pip

#Add the requirements file to /opt/app
COPY requirements.txt /opt/app

#pip install depedencies
RUN pip3 install -r /opt/app/requirements.txt

#Add the flask app to /opt/app
COPY app.py /opt/app/app.py

#Devleopment flask runs on port 5000. Expose.
EXPOSE 5000

#Set the flask app env var
ENV FLASK_APP=/opt/app/app.py

#Define the comamned to execute on container start. Must bind to all, not localhost or loopback
CMD flask run --host=0.0.0.0