Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +2 -7
Dockerfile
CHANGED
|
@@ -1,18 +1,13 @@
|
|
| 1 |
# Dockerfile
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# set workdir
|
| 5 |
WORKDIR /app
|
| 6 |
-
|
| 7 |
-
# copy files
|
| 8 |
COPY . /app
|
| 9 |
|
| 10 |
-
# install deps
|
| 11 |
RUN pip install --no-cache-dir --upgrade pip
|
| 12 |
-
|
|
|
|
| 13 |
|
| 14 |
-
# expose default port Hugging Face uses
|
| 15 |
ENV PORT=7860
|
| 16 |
|
| 17 |
-
# Command to run FastAPI with uvicorn
|
| 18 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--proxy-headers"]
|
|
|
|
| 1 |
# Dockerfile
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
|
|
|
| 4 |
WORKDIR /app
|
|
|
|
|
|
|
| 5 |
COPY . /app
|
| 6 |
|
|
|
|
| 7 |
RUN pip install --no-cache-dir --upgrade pip
|
| 8 |
+
# Install dependencies from requirements.txt if present, else install fallback packages
|
| 9 |
+
RUN if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt; else pip install --no-cache-dir gradio httpx; fi
|
| 10 |
|
|
|
|
| 11 |
ENV PORT=7860
|
| 12 |
|
|
|
|
| 13 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--proxy-headers"]
|