Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +13 -9
Dockerfile
CHANGED
|
@@ -1,18 +1,22 @@
|
|
| 1 |
-
# Use official Python image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
-
# Set
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Copy requirements and install
|
| 8 |
COPY requirements.txt .
|
| 9 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
-
# Copy app
|
| 12 |
-
COPY
|
| 13 |
|
| 14 |
-
# Expose port
|
| 15 |
-
EXPOSE
|
| 16 |
|
| 17 |
-
# Run with Gunicorn
|
| 18 |
-
CMD ["gunicorn", "
|
|
|
|
| 1 |
+
# Use the official Python base image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
+
# Set environment variables
|
| 5 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
| 6 |
+
ENV PYTHONUNBUFFERED=1
|
| 7 |
+
|
| 8 |
+
# Set working directory inside container
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
+
# Copy requirements and install dependencies
|
| 12 |
COPY requirements.txt .
|
| 13 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
| 15 |
+
# Copy the rest of the app
|
| 16 |
+
COPY . .
|
| 17 |
|
| 18 |
+
# Expose the port Flask runs on
|
| 19 |
+
EXPOSE 8080
|
| 20 |
|
| 21 |
+
# Run the app with Gunicorn
|
| 22 |
+
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8080", "app:app"]
|