Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +32 -10
Dockerfile
CHANGED
|
@@ -1,22 +1,44 @@
|
|
| 1 |
-
# Use a slim Python 3.10 base image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Copy all code
|
| 8 |
COPY . .
|
| 9 |
|
| 10 |
# Upgrade pip and install dependencies
|
| 11 |
RUN pip install --upgrade pip
|
| 12 |
-
RUN pip install
|
|
|
|
| 13 |
|
| 14 |
-
#
|
| 15 |
EXPOSE 7860
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
# Start the FastAPI app on the HF assigned port
|
| 20 |
-
# CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--proxy-headers"]
|
| 21 |
-
|
| 22 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# # Use a slim Python 3.10 base image
|
| 2 |
+
# FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# # Set working directory
|
| 5 |
+
# WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# # Copy all code and files into the container
|
| 8 |
+
# COPY . .
|
| 9 |
+
|
| 10 |
+
# # Upgrade pip and install dependencies
|
| 11 |
+
# RUN pip install --upgrade pip
|
| 12 |
+
# RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
+
|
| 14 |
+
# # Optional: expose port (HF injects this automatically)
|
| 15 |
+
# EXPOSE 7860
|
| 16 |
+
|
| 17 |
+
# ENV PORT = 7860
|
| 18 |
+
|
| 19 |
+
# # Start the FastAPI app on the HF assigned port
|
| 20 |
+
# # CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--proxy-headers"]
|
| 21 |
+
|
| 22 |
+
# CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
# Use official Python slim image
|
| 27 |
FROM python:3.10-slim
|
| 28 |
|
| 29 |
# Set working directory
|
| 30 |
WORKDIR /app
|
| 31 |
|
| 32 |
+
# Copy all code
|
| 33 |
COPY . .
|
| 34 |
|
| 35 |
# Upgrade pip and install dependencies
|
| 36 |
RUN pip install --upgrade pip
|
| 37 |
+
RUN pip install -r requirements.txt
|
| 38 |
+
RUN pip install gradio requests # ensure gradio & requests are installed
|
| 39 |
|
| 40 |
+
# Expose HF Space default port (HF sets $PORT automatically)
|
| 41 |
EXPOSE 7860
|
| 42 |
|
| 43 |
+
# Launch the Gradio interface (HF automatically sets PORT)
|
| 44 |
+
CMD ["python", "app.py"]
|
|
|
|
|
|
|
|
|
|
|
|