website / Dockerfile
huylaughmad's picture
Update Dockerfile
69112cc verified
raw
history blame contribute delete
567 Bytes
FROM python:3.11-slim
WORKDIR /app
# Cài đặt các công cụ cần thiết (bỏ gosu và user app)
RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Tạo thư mục cache
RUN mkdir -p /app/hf_cache && \
chmod -R 775 /app/hf_cache
# Sao chép requirements.txt và cài đặt thư viện
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Sao chép toàn bộ mã nguồn
COPY . .
# Chạy Gunicorn trực tiếp
CMD ["gunicorn", "-w", "1", "-b", "0.0.0.0:7860", "app:app"]