umar-sharif821 commited on
Commit
f470f29
·
1 Parent(s): ceecc09

fix: simplify Dockerfile for HF Spaces

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -12
Dockerfile CHANGED
@@ -1,24 +1,16 @@
1
  FROM python:3.11-slim
2
 
3
- # HF Spaces expects port 7860
4
- EXPOSE 7860
5
-
6
  WORKDIR /app
7
 
8
- # Install deps
9
  COPY requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
- # Copy source
13
- COPY env/ ./env/
14
- COPY api/ ./api/
15
- COPY inference.py .
16
- COPY openenv.yaml .
17
 
18
- # Environment variables (override at runtime)
19
  ENV API_BASE_URL="https://api.openai.com/v1"
20
  ENV MODEL_NAME="gpt-4o-mini"
21
  ENV HF_TOKEN=""
22
 
23
- # Start FastAPI server
24
- CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.11-slim
2
 
 
 
 
3
  WORKDIR /app
4
 
 
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
8
+ COPY . .
 
 
 
 
9
 
 
10
  ENV API_BASE_URL="https://api.openai.com/v1"
11
  ENV MODEL_NAME="gpt-4o-mini"
12
  ENV HF_TOKEN=""
13
 
14
+ EXPOSE 7860
15
+
16
+ CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "7860"]