botInfinity commited on
Commit
34db545
·
verified ·
1 Parent(s): 2c93ae4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -10
Dockerfile CHANGED
@@ -1,23 +1,27 @@
1
- # Dockerfile
2
- FROM python:3.11-slim
3
 
4
  WORKDIR /app
5
 
6
- # Install system deps including libGL for OpenCV
7
- RUN apt-get update && apt-get install -y --no-install-recommends \
8
- build-essential \
9
- libsndfile1 \
10
- libgl1-mesa-glx \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # Upgrade pip to avoid dependency resolution issues
14
- RUN pip install --upgrade pip
15
 
 
 
 
 
 
16
  COPY requirements.txt .
 
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
 
19
  COPY . .
20
 
 
21
  EXPOSE 7860
22
 
23
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
 
1
+ FROM python:3.10-slim
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install system deps
6
+ RUN apt-get update && apt-get install -y \
7
+ git \
 
 
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
+ # Copy requirements first (better caching)
 
11
 
12
+
13
+ RUN pip install --no-cache-dir \
14
+ torch==2.1.2+cpu torchvision==0.16.2+cpu \
15
+ -f https://download.pytorch.org/whl/torch_stable.html
16
+
17
  COPY requirements.txt .
18
+
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
+ # Copy app files
22
  COPY . .
23
 
24
+ # Expose HF default port
25
  EXPOSE 7860
26
 
27
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]