Spaces:
Runtime error
Runtime error
Upload Flask backend files
Browse files- Dockerfile +9 -10
- requirements.txt +2 -1
Dockerfile
CHANGED
|
@@ -1,21 +1,20 @@
|
|
| 1 |
-
# Use a lightweight Python image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Copy requirements first
|
| 8 |
-
COPY requirements.txt .
|
| 9 |
|
| 10 |
-
# Install dependencies
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
-
# Copy
|
| 14 |
-
COPY
|
| 15 |
|
| 16 |
-
# Expose
|
| 17 |
EXPOSE 7860
|
| 18 |
|
| 19 |
-
#
|
| 20 |
CMD ["python", "app.py"]
|
| 21 |
-
|
|
|
|
| 1 |
+
# Use a lightweight Python base image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Set working directory inside the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy requirements first to leverage Docker caching
|
| 8 |
+
COPY backend_files/requirements.txt .
|
| 9 |
|
| 10 |
+
# Install Python dependencies
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
+
# Copy the backend app and all necessary files
|
| 14 |
+
COPY backend_files/ .
|
| 15 |
|
| 16 |
+
# Expose the app port
|
| 17 |
EXPOSE 7860
|
| 18 |
|
| 19 |
+
# Launch the Flask app using waitress
|
| 20 |
CMD ["python", "app.py"]
|
|
|
requirements.txt
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
pandas==2.2.2
|
| 3 |
numpy==2.0.2
|
| 4 |
joblib==1.4.2
|
|
|
|
| 1 |
+
Flask==2.2.2
|
| 2 |
+
waitress==2.1.2
|
| 3 |
pandas==2.2.2
|
| 4 |
numpy==2.0.2
|
| 5 |
joblib==1.4.2
|