Create Dockerfile
Browse files- Dockerfile +25 -0
Dockerfile
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official Python runtime as a base image
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy the current directory contents into the container at /app
|
8 |
+
COPY . /app
|
9 |
+
|
10 |
+
# Install system dependencies (if any)
|
11 |
+
RUN apt-get update && apt-get install -y \
|
12 |
+
gcc \
|
13 |
+
&& rm -rf /var/lib/apt/lists/*
|
14 |
+
|
15 |
+
# Install required Python packages from the requirements.txt
|
16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
+
|
18 |
+
# Install Gunicorn and eventlet
|
19 |
+
RUN pip install gunicorn eventlet
|
20 |
+
|
21 |
+
# Expose the port the app will run on
|
22 |
+
EXPOSE 7860
|
23 |
+
|
24 |
+
# Command to run the application using Gunicorn with eventlet worker and threads
|
25 |
+
CMD ["gunicorn", "-b", "0.0.0.0:7860", "-k", "gthread", "--threads", "4", "app:app"]
|