enhancedv / Dockerfile
TDN-M's picture
Update Dockerfile
f4fd91d verified
raw
history blame contribute delete
890 Bytes
# Sử dụng Python 3.9 làm base image
FROM python:3.9-slim
# Cài đặt ffmpeg và các công cụ cần thiết
RUN apt-get update && apt-get install -y \
ffmpeg \
libsm6 libxext6 libxrender-dev \
&& rm -rf /var/lib/apt/lists/*
# Thiết lập biến môi trường cho Matplotlib và Fontconfig
ENV MPLCONFIGDIR=/tmp/matplotlib
ENV FONTCONFIG_PATH=/tmp/fontconfig
ENV FONTCONFIG_FILE=/tmp/fontconfig/fonts.conf
# Tạo thư mục tạm thời và cấp quyền ghi
RUN mkdir -p /tmp/matplotlib /tmp/fontconfig && chmod -R 777 /tmp
# Tạo thư mục làm việc
WORKDIR /app
# Sao chép file requirements.txt vào container
COPY requirements.txt .
# Cài đặt các thư viện Python từ requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Sao chép toàn bộ mã nguồn vào container
COPY . .
# Chạy ứng dụng
CMD ["python", "app.py"]