Maulidaaa commited on
Commit
7dc8bbd
·
verified ·
1 Parent(s): 0b79f9e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -9
Dockerfile CHANGED
@@ -1,31 +1,35 @@
1
- # Gunakan Python image
2
  FROM python:3.10-slim
3
 
4
- # Install dependencies
5
  RUN apt-get update && apt-get install -y \
6
  git \
7
  ffmpeg \
8
  libgl1-mesa-glx \
9
  libglib2.0-0 \
10
- build-essential \
11
- python3-dev \
12
- libglib2.0-0 \
13
  libsm6 \
14
  libxext6 \
15
  libxrender-dev \
 
 
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
- # Set working directory
19
  WORKDIR /app
20
 
21
- # Copy files
22
  COPY . /app
23
 
24
  # Install Python dependencies
25
  RUN pip install --upgrade pip
26
- RUN pip install -r requirements.txt
 
 
 
 
27
 
28
  # Jalankan Flask server
29
  ENV FLASK_APP=app.py
30
  ENV FLASK_RUN_HOST=0.0.0.0
31
- CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"]
 
 
1
+ # Gunakan Python base image
2
  FROM python:3.10-slim
3
 
4
+ # Install dependency sistem
5
  RUN apt-get update && apt-get install -y \
6
  git \
7
  ffmpeg \
8
  libgl1-mesa-glx \
9
  libglib2.0-0 \
 
 
 
10
  libsm6 \
11
  libxext6 \
12
  libxrender-dev \
13
+ build-essential \
14
+ python3-dev \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
+ # Set direktori kerja
18
  WORKDIR /app
19
 
20
+ # Salin semua file ke dalam container
21
  COPY . /app
22
 
23
  # Install Python dependencies
24
  RUN pip install --upgrade pip
25
+ RUN pip install --no-cache-dir -r requirements.txt
26
+
27
+ # Atur variabel environment agar Matplotlib & YOLO tidak error
28
+ ENV MPLCONFIGDIR=/tmp
29
+ ENV YOLO_CONFIG_DIR=/tmp
30
 
31
  # Jalankan Flask server
32
  ENV FLASK_APP=app.py
33
  ENV FLASK_RUN_HOST=0.0.0.0
34
+
35
+ CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"]