Dyna-99 commited on
Commit
791628a
·
verified ·
1 Parent(s): dbae4d1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -17
Dockerfile CHANGED
@@ -1,17 +1,24 @@
1
- # Gunakan Python image
2
- FROM python:3.10-slim
3
-
4
- # Set working directory
5
- WORKDIR /app
6
-
7
- # Salin semua file ke container
8
- COPY . .
9
-
10
- # Install dependencies
11
- RUN pip install --no-cache-dir -r requirements.txt
12
-
13
- # Expose port yang digunakan Flask
14
- EXPOSE 7860
15
-
16
- # Jalankan aplikasi Flask
17
- CMD ["python", "app.py"]
 
 
 
 
 
 
 
 
1
+ # Gunakan Python image
2
+ FROM python:3.10-slim
3
+
4
+ # Set environment variables untuk cache Hugging Face agar tidak nulis ke /.cache
5
+ ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers
6
+ ENV HF_HOME=/tmp/huggingface
7
+
8
+ # Set working directory
9
+ WORKDIR /app
10
+
11
+ # Salin semua file ke container
12
+ COPY . .
13
+
14
+ # Install dependencies
15
+ RUN pip install --no-cache-dir -r requirements.txt
16
+
17
+ # Buat folder cache yang bisa ditulis
18
+ RUN mkdir -p /tmp/huggingface && chmod -R 777 /tmp/huggingface
19
+
20
+ # Expose port yang digunakan Flask
21
+ EXPOSE 7860
22
+
23
+ # Jalankan aplikasi Flask
24
+ CMD ["python", "app.py"]