Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +18 -0
Dockerfile
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Gunakan image Python yang memiliki kompiler dan pustaka dasar
|
| 2 |
+
FROM python:3.12-slim
|
| 3 |
+
|
| 4 |
+
# Setting environment
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Menginstal dependensi
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
+
|
| 11 |
+
# Menyalin kode aplikasi
|
| 12 |
+
COPY app.py .
|
| 13 |
+
|
| 14 |
+
# Expose port (opsional, tetapi baik untuk dokumentasi)
|
| 15 |
+
EXPOSE 7860
|
| 16 |
+
|
| 17 |
+
# Command untuk menjalankan aplikasi (menggunakan Gunicorn sebagai server web)
|
| 18 |
+
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:7860", "--workers", "1", "--worker-class", "uvicorn.workers.UvicornWorker"]
|