testdouy / Dockerfile
geopromini's picture
Upload Dockerfile
f183eab verified
raw
history blame contribute delete
728 Bytes
# Sử dụng một base image có Python
FROM python:3.10-slim
# Thiết lập môi trường
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /app
# Cài đặt các dependencies hệ thống tối thiểu
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Cài đặt các thư viện Python
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Sao chép code ứng dụng
COPY app.py .
# Chuyển sang user không phải root để tăng bảo mật
RUN useradd -m appuser
USER appuser
# Expose port và chạy ứng dụng FastAPI
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]