Update Dockerfile
Browse files- Dockerfile +27 -13
Dockerfile
CHANGED
|
@@ -1,21 +1,35 @@
|
|
| 1 |
-
|
| 2 |
-
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
|
| 8 |
-
COPY requirements.txt .
|
| 9 |
-
|
| 10 |
-
# Install dependencies
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
-
# Copy the rest of the code
|
| 14 |
COPY . .
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
# Run with Gunicorn (production server)
|
| 20 |
-
#CMD ["python", "app.py"]
|
| 21 |
-
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:5000", "--workers", "4"]
|
|
|
|
| 1 |
+
FROM python:3.9-slim
|
|
|
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
COPY requirements.txt requirements.txt
|
|
|
|
|
|
|
|
|
|
| 6 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 7 |
|
|
|
|
| 8 |
COPY . .
|
| 9 |
|
| 10 |
+
EXPOSE 7860
|
| 11 |
+
|
| 12 |
+
# Run with gunicorn instead of python
|
| 13 |
+
CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:7860", "app:app"]
|
| 14 |
+
|
| 15 |
+
# # Use a lightweight Python image
|
| 16 |
+
# FROM python:3.10-slim
|
| 17 |
+
|
| 18 |
+
# # Set working directory
|
| 19 |
+
# WORKDIR /app
|
| 20 |
+
|
| 21 |
+
# # Copy requirements first (for caching layers)
|
| 22 |
+
# COPY requirements.txt .
|
| 23 |
+
|
| 24 |
+
# # Install dependencies
|
| 25 |
+
# RUN pip install --no-cache-dir -r requirements.txt
|
| 26 |
+
|
| 27 |
+
# # Copy the rest of the code
|
| 28 |
+
# COPY . .
|
| 29 |
+
|
| 30 |
+
# # Expose the port Flask/Gunicorn will run on
|
| 31 |
+
# EXPOSE 5000
|
| 32 |
|
| 33 |
+
# # Run with Gunicorn (production server)
|
| 34 |
+
# #CMD ["python", "app.py"]
|
| 35 |
+
# CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:5000", "--workers", "4"]
|