Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +24 -17
Dockerfile
CHANGED
@@ -1,17 +1,24 @@
|
|
1 |
-
# Gunakan Python image
|
2 |
-
FROM python:3.10-slim
|
3 |
-
|
4 |
-
# Set
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"]
|