jarvis0852 commited on
Commit
f8967f8
·
verified ·
1 Parent(s): 69a8ff3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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
- RUN pip install --no-cache-dir fastapi uvicorn[standard] httpx
 
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"]