shukdev3 commited on
Commit
f2037ee
Β·
verified Β·
1 Parent(s): 474e2d9

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -0
Dockerfile ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ── ShukGEN v3 β€” Hugging Face Spaces Dockerfile ──────────────────────────────
2
+ # Uses CPU-only PyTorch to keep the image lean (no CUDA drivers needed on HF).
3
+ # If you have a GPU Space, replace the torch install line with the CUDA wheel.
4
+ # ─────────────────────────────────────────────────────────────────────────────
5
+
6
+ FROM python:3.10-slim
7
+
8
+ # System deps (needed by Pillow / scipy)
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ libglib2.0-0 \
11
+ libsm6 \
12
+ libxrender1 \
13
+ libxext6 \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ WORKDIR /app
17
+
18
+ # Copy requirements first so Docker can cache the pip layer
19
+ COPY requirements.txt .
20
+
21
+ # Install CPU-only PyTorch + everything else
22
+ RUN pip install --no-cache-dir \
23
+ torch==2.2.2+cpu \
24
+ torchvision==0.17.2+cpu \
25
+ --index-url https://download.pytorch.org/whl/cpu \
26
+ && pip install --no-cache-dir -r requirements.txt
27
+
28
+ # Copy all app files (app.py, index.html, model.pt if present)
29
+ COPY . .
30
+
31
+ # HF Spaces requires port 7860
32
+ EXPOSE 7860
33
+
34
+ # Run the Flask server
35
+ CMD ["python", "app.py"]