madebyace commited on
Commit
e857e3b
·
verified ·
1 Parent(s): 70bb681

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -5
Dockerfile CHANGED
@@ -2,21 +2,21 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install system dependencies (if any needed for torch/transformers)
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  build-essential \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
  COPY requirements.txt .
11
 
12
- # Install CPU-only torch to save space, then other requirements
13
  RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
  COPY . .
17
 
18
- # Expose the port
19
- ENV PORT=8080
20
 
21
  # Command to run the app
22
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  build-essential \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
  COPY requirements.txt .
11
 
12
+ # Install CPU-only torch to save space
13
  RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
  COPY . .
17
 
18
+ # Hugging Face Spaces serves on port 7860 by default
19
+ ENV PORT=7860
20
 
21
  # Command to run the app
22
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]