File size: 849 Bytes
99a7be2
 
b6ae7b8
99a7be2
b6ae7b8
 
99a7be2
 
 
b6ae7b8
99a7be2
b6ae7b8
 
 
fcb2b04
 
99a7be2
 
fcb2b04
99a7be2
 
fcb2b04
99a7be2
 
fcb2b04
99a7be2
 
fcb2b04
99a7be2
 
b6ae7b8
99a7be2
 
 
b6ae7b8
99a7be2
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Stack 2.9 HuggingFace Spaces Dockerfile
# Optimized for 16GB GPU with 4-bit quantization

FROM python:3.10-slim

# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV TRANSFORMERS_CACHE=/workspace/.cache/huggingface
ENV HF_HOME=/workspace/.cache/huggingface

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    wget \
    && rm -rf /var/lib/apt/lists/*

# Create workspace directory
WORKDIR /workspace

# Copy requirements first for better caching
COPY requirements.txt .

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy application files
COPY . .

# Expose Gradio port
EXPOSE 7860

# Create startup script
RUN echo '#!/bin/bash\necho "🚀 Starting Stack 2.9..."\npython app.py --port 7860 --share' > /start.sh
RUN chmod +x /start.sh

# Launch command
CMD ["/start.sh"]