Spaces:
Running
Running
Commit
·
eeb5e2c
1
Parent(s):
8509791
version 2
Browse files- Dockerfile +8 -6
Dockerfile
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
# Use official Python 3.10 slim image as base for smaller footprint
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# Set working directory
|
|
@@ -15,14 +14,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 15 |
libc-dev \
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
-
# Copy
|
| 19 |
-
COPY . .
|
| 20 |
|
| 21 |
# Install Python dependencies
|
| 22 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
# Command to run the application
|
| 28 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
# Set working directory
|
|
|
|
| 14 |
libc-dev \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
+
# Copy requirements first for better caching
|
| 18 |
+
COPY requirements.txt .
|
| 19 |
|
| 20 |
# Install Python dependencies
|
| 21 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 22 |
|
| 23 |
+
# Copy all files from the root directory
|
| 24 |
+
COPY . .
|
| 25 |
+
|
| 26 |
+
# Expose HF Spaces port
|
| 27 |
+
EXPOSE 7860
|
| 28 |
|
| 29 |
# Command to run the application
|
| 30 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--timeout-keep-alive", "120"]
|