Create Dockerfile
Browse files- Dockerfile +21 -0
Dockerfile
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dockerfile
|
| 2 |
+
# Use an official Python runtime as a parent image
|
| 3 |
+
FROM python:3.9-slim
|
| 4 |
+
|
| 5 |
+
# Set the working directory in the container
|
| 6 |
+
WORKDIR /app
|
| 7 |
+
|
| 8 |
+
# Copy the requirements file into the container at /app
|
| 9 |
+
COPY requirements.txt .
|
| 10 |
+
|
| 11 |
+
# Install any needed packages specified in requirements.txt
|
| 12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
+
|
| 14 |
+
# Copy the rest of the application's code (including templates folder)
|
| 15 |
+
COPY . .
|
| 16 |
+
|
| 17 |
+
# Expose the port the app runs on
|
| 18 |
+
EXPOSE 7860
|
| 19 |
+
|
| 20 |
+
# Run app.py when the container launches
|
| 21 |
+
CMD ["gunicorn", "--workers", "1", "--threads", "4", "--bind", "0.0.0.0:7860", "app:app"]
|