Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +9 -22
Dockerfile
CHANGED
|
@@ -1,35 +1,22 @@
|
|
| 1 |
-
FROM python:3.10-slim
|
| 2 |
-
|
| 3 |
-
WORKDIR /app
|
| 4 |
-
|
| 5 |
-
COPY . .
|
| 6 |
-
|
| 7 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 8 |
-
|
| 9 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
# Use a lightweight Python image
|
| 16 |
-
|
| 17 |
|
| 18 |
# Set working directory
|
| 19 |
-
|
| 20 |
|
| 21 |
# Copy all backend code
|
| 22 |
-
|
| 23 |
-
|
|
|
|
| 24 |
|
| 25 |
# Install dependencies
|
| 26 |
-
|
| 27 |
|
| 28 |
# Set PYTHONPATH so FastAPI can import from utils
|
| 29 |
-
|
| 30 |
|
| 31 |
# Expose the port FastAPI will run on
|
| 32 |
-
|
| 33 |
|
| 34 |
# Command to run the app
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Use a lightweight Python image
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
|
| 7 |
# Copy all backend code
|
| 8 |
+
COPY Backend/ ./Backend
|
| 9 |
+
COPY requirements.txt .
|
| 10 |
+
COPY . .
|
| 11 |
|
| 12 |
# Install dependencies
|
| 13 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
| 15 |
# Set PYTHONPATH so FastAPI can import from utils
|
| 16 |
+
ENV PYTHONPATH="${PYTHONPATH}:/app/Backend"
|
| 17 |
|
| 18 |
# Expose the port FastAPI will run on
|
| 19 |
+
EXPOSE 7860
|
| 20 |
|
| 21 |
# Command to run the app
|
| 22 |
+
CMD ["uvicorn", "Backend.main:app", "--host", "0.0.0.0", "--port", "7860"]
|