Spaces:
Sleeping
Sleeping
Upload Dockerfile
Browse files- Dockerfile +19 -0
Dockerfile
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 1️⃣ Use an official slim Python image
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
+
|
| 4 |
+
# 2️⃣ Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# 3️⃣ Copy requirements first
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
|
| 10 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
+
|
| 12 |
+
# 4️⃣ Copy all files from the root of your project (app.py, .h5, .json, results dir, etc.)
|
| 13 |
+
COPY . .
|
| 14 |
+
|
| 15 |
+
# 5️⃣ Expose the port
|
| 16 |
+
EXPOSE 7860
|
| 17 |
+
|
| 18 |
+
# 6️⃣ Command to run the app
|
| 19 |
+
CMD ["python", "app.py"]
|