Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +9 -6
Dockerfile
CHANGED
|
@@ -1,13 +1,16 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM python:3.
|
| 3 |
|
| 4 |
-
# Set the 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 application files
|
|
@@ -16,5 +19,5 @@ COPY . .
|
|
| 16 |
# Expose the port your app runs on
|
| 17 |
EXPOSE 7860
|
| 18 |
|
| 19 |
-
# Command to run the application
|
| 20 |
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]
|
|
|
|
| 1 |
+
# Use Python 3.10+ to avoid NumPy version conflicts
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Set the working directory inside the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Upgrade pip first to avoid dependency issues
|
| 8 |
+
RUN pip install --no-cache-dir --upgrade pip
|
| 9 |
+
|
| 10 |
+
# Copy only the requirements file first for caching efficiency
|
| 11 |
COPY requirements.txt .
|
| 12 |
|
| 13 |
+
# Install dependencies (ensure `pickle` is removed from requirements.txt)
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
# Copy the rest of the application files
|
|
|
|
| 19 |
# Expose the port your app runs on
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
+
# Command to run the application using Gunicorn
|
| 23 |
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]
|