File size: 828 Bytes
bea810c
add552c
bea810c
add552c
bea810c
 
 
 
 
add552c
bea810c
 
add552c
bea810c
 
 
 
 
 
 
 
 
1ed7983
bea810c
 
add552c
bea810c
 
 
 
 
 
 
 
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
FROM python:3.10-slim

WORKDIR /app

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

# Install PyTorch with CUDA support
RUN pip install --no-cache-dir torch==2.1.0 torchvision==0.16.0 --extra-index-url https://download.pytorch.org/whl/cu118

# Install FastAPI and other dependencies
RUN pip install --no-cache-dir fastapi==0.104.1 \
    uvicorn==0.23.2 \
    python-multipart==0.0.6 \
    pillow==10.0.1 \
    safetensors==0.4.0 \
    transformers==4.34.0 \
    diffusers==0.23.0 \
    accelerate==0.23.0

# Copy application code
COPY . .

# Create model directory
RUN mkdir -p models

# Expose the port the app will run on
EXPOSE 7860

# Start the FastAPI application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]