Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +11 -3
Dockerfile
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
|
|
|
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
COPY requirements.txt .
|
| 7 |
|
|
|
|
| 8 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 9 |
|
|
|
|
| 10 |
EXPOSE 7860
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
| 1 |
+
# Use a slim Python base image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Set working dir into the 'main' folder
|
| 5 |
+
WORKDIR /app/main
|
| 6 |
|
| 7 |
+
# Copy only the contents of your app folder
|
| 8 |
+
COPY main/ .
|
| 9 |
+
|
| 10 |
+
# Copy requirements into the same dir
|
| 11 |
COPY requirements.txt .
|
| 12 |
|
| 13 |
+
# Install deps
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
+
# Expose FastAPI port
|
| 17 |
EXPOSE 7860
|
| 18 |
|
| 19 |
+
# Launch Uvicorn looking for "app" inside main.py
|
| 20 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|