Spaces:
Runtime error
Runtime error
mdadul
commited on
Commit
·
9f8b41e
1
Parent(s):
8d4ab19
update dockerfile
Browse files- Dockerfile +6 -10
Dockerfile
CHANGED
@@ -1,22 +1,18 @@
|
|
1 |
-
#
|
2 |
-
FROM python:3.9-slim
|
|
|
|
|
3 |
WORKDIR /app
|
4 |
|
5 |
# Copy requirements and install dependencies
|
6 |
COPY app/requirements.txt /app/requirements.txt
|
7 |
RUN pip install --no-cache-dir -r /app/requirements.txt
|
8 |
|
9 |
-
#
|
10 |
-
FROM python:3.9-slim
|
11 |
-
WORKDIR /app
|
12 |
-
COPY --from=builder /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
|
13 |
COPY app /app
|
14 |
|
15 |
-
# Expose port
|
16 |
EXPOSE 8000
|
17 |
|
18 |
-
# Set environment variables
|
19 |
-
ENV PYTHONUNBUFFERED=1
|
20 |
-
|
21 |
# Command to run the FastAPI app
|
22 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
1 |
+
# Use a lightweight Python image
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Set the working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
# Copy requirements and install dependencies
|
8 |
COPY app/requirements.txt /app/requirements.txt
|
9 |
RUN pip install --no-cache-dir -r /app/requirements.txt
|
10 |
|
11 |
+
# Copy the rest of the app code
|
|
|
|
|
|
|
12 |
COPY app /app
|
13 |
|
14 |
+
# Expose the port FastAPI will use
|
15 |
EXPOSE 8000
|
16 |
|
|
|
|
|
|
|
17 |
# Command to run the FastAPI app
|
18 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|