Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +8 -10
Dockerfile
CHANGED
@@ -1,23 +1,21 @@
|
|
1 |
-
# Use the official Python image as the base
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
-
# Set
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
#
|
8 |
COPY requirements.txt .
|
9 |
-
|
10 |
-
# Install dependencies from requirements.txt
|
11 |
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
|
13 |
-
# Copy
|
14 |
COPY . .
|
15 |
|
16 |
-
# Expose the port
|
17 |
-
EXPOSE
|
18 |
|
19 |
-
#
|
20 |
ENV PATH="/app:${PATH}"
|
21 |
|
22 |
-
#
|
23 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# Use the official Python image as the base
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
+
# Set working dir
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Copy & install deps
|
8 |
COPY requirements.txt .
|
|
|
|
|
9 |
RUN pip install --no-cache-dir -r requirements.txt
|
10 |
|
11 |
+
# Copy app files
|
12 |
COPY . .
|
13 |
|
14 |
+
# Expose the same port you run on
|
15 |
+
EXPOSE 7860
|
16 |
|
17 |
+
# Make sure PATH includes /app
|
18 |
ENV PATH="/app:${PATH}"
|
19 |
|
20 |
+
# Run FastAPI via Uvicorn on port 7860
|
21 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|