-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (23 loc) · 1.05 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
# Use the official Python image from the Docker Hub
FROM python:3.9-slim
# Set the working directory in the container
# this allows for any subsequent commands to be run from this directory
WORKDIR /app
# Copy the current directory contents into the container at /app
# . indicates the directory where the Dockerfile is located and copies all
# files in that directory into our container working directory
COPY . /app
# Install any needed packages specified in requirements.txt
# using --no-cache-dir to not cache the packages and save space
RUN pip install --no-cache-dir -r requirements.txt
# Make port 5000 available to the world outside this container
EXPOSE 80
# Define environment variable
# FLASK_APP is a framework specific environmnent variable that tells
# the flask command where the application is located
#without this the flask run command will not know what app to run.
ENV FLASK_APP=app.py
# Run app.py when the container launches
# 0.0.0.0 sets the application to listen on all network interfaces
# Set the command to run the app
CMD ["python", "app.py"]