Spaces:
Build error
Build error
Create Dockerfile
Browse files- Dockerfile +20 -0
Dockerfile
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 1. Base Image Python
|
2 |
+
FROM python:3.12-slim
|
3 |
+
|
4 |
+
# 2. Memperbarui pip dan setuptools ke versi terbaru
|
5 |
+
RUN pip install --upgrade pip setuptools
|
6 |
+
|
7 |
+
# 3. Menyalin file requirements.txt ke dalam container
|
8 |
+
COPY requirements.txt /app/requirements.txt
|
9 |
+
|
10 |
+
# 4. Menginstal dependensi Python dari requirements.txt
|
11 |
+
RUN pip install --no-cache-dir -r /app/requirements.txt
|
12 |
+
|
13 |
+
# 5. Menyalin semua file aplikasi Anda ke container
|
14 |
+
COPY . /app
|
15 |
+
|
16 |
+
# 6. Menetapkan direktori kerja di dalam container
|
17 |
+
WORKDIR /app
|
18 |
+
|
19 |
+
# 7. Menjalankan aplikasi (ganti 'app.py' dengan nama skrip aplikasi Anda)
|
20 |
+
CMD ["python", "app.py"]
|