File size: 505 Bytes
a6161e8
8fddf39
a3665a2
 
 
 
 
 
 
 
 
a6161e8
 
 
a3665a2
8f0238e
af31c4b
a6161e8
8f0238e
 
 
5b02bb8
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.9
ENV CUDA_VISIBLE_DEVICES=-1
# Cài thêm libGL và các phụ thuộc
RUN apt-get update && apt-get install -y \
    libgl1 \
    libsm6 \
    libxext6 \
    libxrender1 \
  && rm -rf /var/lib/apt/lists/*

# Tạo user không root
RUN useradd -m -u 1000 user

WORKDIR /app
COPY --chown=user requirements.txt .

RUN pip install --upgrade pip && pip install -r requirements.txt

COPY --chown=user . .

USER user
EXPOSE 7860
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]