Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +12 -12
Dockerfile
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
# Copy files
|
| 8 |
-
COPY app.py /app/
|
| 9 |
-
COPY author_svms.pkl /app/
|
| 10 |
-
COPY label_map.pkl /app/
|
| 11 |
-
COPY requirements.txt /app/
|
| 12 |
-
|
| 13 |
-
# Install dependencies
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
| 1 |
+
# Base image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
|
| 4 |
+
# Set work directory
|
| 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 code
|
| 12 |
+
COPY app.py .
|
| 13 |
+
|
| 14 |
+
# Expose API port
|
| 15 |
+
EXPOSE 7860
|
| 16 |
|
| 17 |
+
# Command to run FastAPI
|
| 18 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|