File size: 887 Bytes
e68575e
f92e617
 
e68575e
 
f92e617
335436e
40a0299
335436e
 
f92e617
 
 
40a0299
f92e617
bad4c51
597b716
4e81420
597b716
 
 
bad4c51
 
 
 
4e81420
03d1853
bad4c51
4e81420
 
 
bad4c51
f92e617
bad4c51
 
43b6466
 
f92e617
bad4c51
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
38
39
40
# CACHE BUSTER: 2025-09-18-01
FROM python:3.12-slim

# Install system dependencies needed for libraries like opencv-python-headless
RUN apt-get update && apt-get install -y --no-install-recommends \
    libglib2.0-0 \
    build-essential \
    ffmpeg \
    cmake \
    pkg-config \
    libsm6 \
    libxext6 \
    libxrender1 \
    libgl1-mesa-dev \
    && rm -rf /var/lib/apt/lists/*


RUN useradd -m myuser

ENV HF_HOME=/tmp/huggingface

# Set the working directory
WORKDIR /app

# Copy requirements.txt and install dependencies
COPY --chown=myuser:myuser requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt

COPY --chown=myuser:myuser . .
USER myuser


# Expose the port used by FastAPI
EXPOSE 7860

RUN mkdir -p static/output && chmod -R 777 static/output

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