feliksius commited on
Commit
19dec0c
·
verified ·
1 Parent(s): be77a15

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -3
Dockerfile CHANGED
@@ -7,13 +7,13 @@ WORKDIR /app
7
  # Buat direktori cache dan atur izin
8
  RUN mkdir -p /app/cache && chmod -R 777 /app/cache
9
 
 
 
 
10
  # Salin requirements.txt dan install dependensi
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
- # Bersihkan cache lama (opsional, untuk mencegah error)
15
- RUN rm -rf /app/cache
16
-
17
  # Salin kode aplikasi
18
  COPY app.py .
19
 
@@ -21,5 +21,8 @@ COPY app.py .
21
  ENV HF_HOME=/app/cache
22
  ENV TRANSFORMERS_CACHE=/app/cache
23
 
 
 
 
24
  # Jalankan aplikasi dengan uvicorn
25
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
7
  # Buat direktori cache dan atur izin
8
  RUN mkdir -p /app/cache && chmod -R 777 /app/cache
9
 
10
+ # Bersihkan cache lama (untuk mencegah error izin)
11
+ RUN rm -rf /app/cache/* && chmod -R 777 /app/cache
12
+
13
  # Salin requirements.txt dan install dependensi
14
  COPY requirements.txt .
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
 
 
 
17
  # Salin kode aplikasi
18
  COPY app.py .
19
 
 
21
  ENV HF_HOME=/app/cache
22
  ENV TRANSFORMERS_CACHE=/app/cache
23
 
24
+ # Pastikan izin direktori cache tetap benar sebelum menjalankan aplikasi
25
+ RUN chmod -R 777 /app/cache
26
+
27
  # Jalankan aplikasi dengan uvicorn
28
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]