-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (21 loc) · 693 Bytes
/
Dockerfile
File metadata and controls
31 lines (21 loc) · 693 Bytes
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
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set the working directory in the container to /app
WORKDIR /app
# Upgrade pip
RUN /usr/local/bin/python -m pip install --upgrade pip
# Add requirements.txt file to the container
COPY requirements.txt ./
# Install any needed packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt
# Add the current directory contents into the container at /app
COPY . ./
# Run tests
# RUN python -m unittest discover -v
# Expose port
EXPOSE 5000
# Set Flask environment variables
ENV FLASK_APP=app.py
ENV FLASK_RUN_HOST=0.0.0.0
# Run the application
CMD ["python3", "app.py"]