Spaces:
Runtime error
Runtime error
Commit
·
629c3f3
1
Parent(s):
2d8d396
change
Browse files- Dockerfile +9 -5
Dockerfile
CHANGED
@@ -1,13 +1,17 @@
|
|
1 |
-
# Use the official Python image
|
2 |
FROM python:3.9-slim
|
3 |
|
|
|
|
|
|
|
4 |
|
5 |
-
# Copy
|
6 |
COPY requirements.txt .
|
7 |
RUN pip install --no-cache-dir -r requirements.txt
|
8 |
|
9 |
-
|
|
|
10 |
EXPOSE 8000
|
11 |
|
12 |
-
#
|
13 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
1 |
+
# Use the official Python image
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
+
# Set environment variables
|
5 |
+
ENV PYTHONUNBUFFERED=1 \
|
6 |
+
PYTHONDONTWRITEBYTECODE=1
|
7 |
|
8 |
+
# Copy and install dependencies
|
9 |
COPY requirements.txt .
|
10 |
RUN pip install --no-cache-dir -r requirements.txt
|
11 |
|
12 |
+
|
13 |
+
# Expose the FastAPI port
|
14 |
EXPOSE 8000
|
15 |
|
16 |
+
# Run FastAPI (fix import issue by using `app.main`)
|
17 |
+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|