File size: 868 Bytes
14cbedd
 
a4c42ae
7966cfa
 
 
a4c42ae
 
 
 
9d8b09e
 
35bdc26
7966cfa
14cbedd
a4c42ae
9d8b09e
a4c42ae
35bdc26
7966cfa
a4c42ae
14cbedd
9d8b09e
a4c42ae
14cbedd
 
 
 
 
 
7966cfa
a4c42ae
7966cfa
 
14cbedd
a4c42ae
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
# Dockerfile for AI Background Changer

FROM python:3.10-slim

WORKDIR /app

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

# Copy requirements first
COPY requirements.txt .

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

# Copy application files
COPY . .

# Create necessary directories with permissions
RUN mkdir -p uploads results models && chmod -R 777 uploads results models

# Download SAM model if not present (optional - you have it locally)
# RUN if [ ! -f models/sam_vit_b_01ec64.pth ]; then \
#     wget -P models/ https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth; \
#     fi

# Expose port
EXPOSE 7860

# Run application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]