File size: 879 Bytes
0548f95
06f23f8
 
 
 
45fa024
 
 
 
 
 
 
 
 
 
06f23f8
 
 
23ca9bc
271b2e9
 
23ca9bc
271b2e9
 
8af9033
144dd46
 
 
7372155
06f23f8
 
 
 
 
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

# Set working directory
WORKDIR /app

# Install system dependencies, including libgl1 for OpenCV
RUN apt-get update && apt-get install -y \
    git \
    git-lfs \
    gcc \
    python3-dev \
    libgl1 \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

# Clone the FastSD CPU repository
RUN git clone https://github.com/rupeshs/fastsdcpu.git .

# Create and set permissions for writable directories
RUN mkdir -p /.cache/huggingface /app/configs /app/results /app/.openvino_telemetry \
    && chmod -R 777 /.cache /app

# Set HF_HOME for Hugging Face cache (replacing TRANSFORMERS_CACHE)
ENV HF_HOME=/app/.cache/huggingface

# Upgrade pip and install dependencies
RUN pip install --upgrade pip
RUN pip install -r requirements.txt

# Expose port for FastAPI server
EXPOSE 8000

# Command to run the FastAPI server
CMD ["python", "src/app.py", "--api"]