natalieparker commited on
Commit
eafc074
·
verified ·
1 Parent(s): 3512ce0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -4
Dockerfile CHANGED
@@ -1,13 +1,23 @@
1
- FROM python:3.10
2
 
 
 
 
 
 
3
  WORKDIR /app
4
 
 
5
  COPY requirements.txt .
6
 
 
7
  RUN pip install --no-cache-dir -r requirements.txt
8
 
 
 
 
9
  COPY . .
10
 
11
- EXPOSE 7860
12
-
13
- CMD ["python", "app.py"]
 
1
+ FROM python:3.10-slim
2
 
3
+ # Set environment variables
4
+ ENV HOME /app
5
+ ENV PATH="/usr/local/bin:$PATH"
6
+
7
+ # Create and set working directory
8
  WORKDIR /app
9
 
10
+ # Copy requirement files
11
  COPY requirements.txt .
12
 
13
+ # Install dependencies
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
+ # Copy application files (app.py and model weights)
17
+ # IMPORTANT: All your model files (config.json, model.safetensors, etc.)
18
+ # MUST be uploaded to the root of your Hugging Face repo alongside this Dockerfile.
19
  COPY . .
20
 
21
+ # Set the command to run the FastAPI application
22
+ # This is the standard, reliable entry point for FastAPI on Hugging Face Spaces.
23
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]