-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (17 loc) · 729 Bytes
/
Dockerfile
File metadata and controls
24 lines (17 loc) · 729 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
# Use an official lightweight Python image.
FROM python:3.9-slim
# Set the working directory in the container.
WORKDIR /app
# Copy the requirements file first to leverage Docker cache.
COPY requirements.txt .
# Set a trusted pip mirror for faster installs.
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# Install the dependencies.
RUN pip install -r requirements.txt
# Copy the rest of the application's code.
COPY . .
# Expose the port the app runs on.
EXPOSE 5000
# Define the command to run the application using a production-ready server.
# We use gunicorn with the 'gevent' worker type, which is ideal for streaming.
CMD ["gunicorn", "-k", "gevent", "--bind", "0.0.0.0:5000", "app:app"]