fullstack commited on
Commit
ea79faf
·
1 Parent(s): c26b1d9
Files changed (1) hide show
  1. Dockerfile +41 -0
Dockerfile ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ZeroGPU Dockerfile for HF Spaces Pro
2
+ # Uses NVIDIA H200 GPUs with 70GB VRAM
3
+ FROM python:3.9
4
+
5
+ # Set environment variables
6
+ ENV PYTHONUNBUFFERED=1
7
+
8
+ # Install system dependencies
9
+ RUN apt-get update && apt-get install -y \
10
+ git \
11
+ wget \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Create user (required for HF Spaces)
15
+ RUN useradd -m -u 1000 user
16
+ WORKDIR /app
17
+
18
+ # Copy requirements first for better caching
19
+ COPY --chown=user requirements.txt .
20
+
21
+ # Install Python dependencies
22
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
23
+
24
+ # Install PyTorch with CUDA support for H200
25
+ RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
26
+
27
+ # Copy application code
28
+ COPY --chown=user . .
29
+
30
+ # Switch to user
31
+ USER user
32
+
33
+ # Set environment variables for user
34
+ ENV HOME=/home/user \
35
+ PATH=/home/user/.local/bin:$PATH
36
+
37
+ # Expose port
38
+ EXPOSE 7860
39
+
40
+ # Command to run the application
41
+ CMD ["python3", "app.py"]