File size: 748 Bytes
7dc8bbd b9449ed 7dc8bbd b9449ed baa0185 b9449ed 682c18a 7dc8bbd b9449ed 7dc8bbd b9449ed 7dc8bbd b9449ed 682c18a 7dc8bbd b9449ed 682c18a 7dc8bbd |
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 |
# Gunakan Python base image
FROM python:3.10-slim
# Install dependency sistem
RUN apt-get update && apt-get install -y \
git \
ffmpeg \
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
build-essential \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Set direktori kerja
WORKDIR /app
# Salin semua file ke dalam container
COPY . /app
# Install Python dependencies
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Atur variabel environment agar Matplotlib & YOLO tidak error
ENV MPLCONFIGDIR=/tmp
ENV YOLO_CONFIG_DIR=/tmp
# Jalankan Flask server
ENV FLASK_APP=app.py
ENV FLASK_RUN_HOST=0.0.0.0
CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"]
|