Valtry commited on
Commit
2cf7ffd
·
verified ·
1 Parent(s): bed4713

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -10
Dockerfile CHANGED
@@ -1,20 +1,17 @@
1
- FROM python:3.10
2
 
3
- # Install system dependencies
4
- RUN apt-get update && apt-get install -y git
5
-
6
- # Set workdir
7
  WORKDIR /app
8
 
9
- # Copy files
 
10
  COPY app.py /app/app.py
11
  COPY static /app/static
 
12
 
13
- # Install Python dependencies
14
- RUN pip install --no-cache-dir fastapi uvicorn diffusers transformers accelerate safetensors torch Pillow
 
15
 
16
- # Expose port
17
  EXPOSE 7860
18
 
19
- # Run app
20
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.10-slim
2
 
 
 
 
 
3
  WORKDIR /app
4
 
5
+ RUN apt-get update && apt-get install -y git build-essential && rm -rf /var/lib/apt/lists/*
6
+
7
  COPY app.py /app/app.py
8
  COPY static /app/static
9
+ COPY requirements.txt /app/requirements.txt
10
 
11
+ # Install CPU-only torch wheel (this will install CPU PyTorch)
12
+ RUN pip install --no-cache-dir torch --extra-index-url https://download.pytorch.org/whl/cpu
13
+ RUN pip install --no-cache-dir -r /app/requirements.txt
14
 
 
15
  EXPOSE 7860
16
 
 
17
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]