Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +21 -21
Dockerfile
CHANGED
|
@@ -1,21 +1,21 @@
|
|
| 1 |
-
# 1. Start with a lightweight Python image
|
| 2 |
-
FROM python:3.10-slim
|
| 3 |
-
|
| 4 |
-
# 2. Set the directory inside the cloud server
|
| 5 |
-
WORKDIR /app
|
| 6 |
-
|
| 7 |
-
# 3. Install required system libraries for OpenCV to work in the cloud
|
| 8 |
-
RUN apt-get update && apt-get install -y libgl1-mesa-glx libglib2.0-0
|
| 9 |
-
|
| 10 |
-
# 4. Copy your requirements file and install the Python libraries
|
| 11 |
-
COPY requirements.txt .
|
| 12 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
-
|
| 14 |
-
# 5. Copy all your project files (app.py, templates, models, etc.)
|
| 15 |
-
COPY . .
|
| 16 |
-
|
| 17 |
-
# 6. Hugging Face exposes port 7860 by default
|
| 18 |
-
EXPOSE 7860
|
| 19 |
-
|
| 20 |
-
# 7. Start the Flask server using Gunicorn (production-ready)
|
| 21 |
-
CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "120", "
|
|
|
|
| 1 |
+
# 1. Start with a lightweight Python image
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# 2. Set the directory inside the cloud server
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# 3. Install required system libraries for OpenCV to work in the cloud
|
| 8 |
+
RUN apt-get update && apt-get install -y libgl1-mesa-glx libglib2.0-0
|
| 9 |
+
|
| 10 |
+
# 4. Copy your requirements file and install the Python libraries
|
| 11 |
+
COPY requirements.txt .
|
| 12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
+
|
| 14 |
+
# 5. Copy all your project files (app.py, templates, models, etc.)
|
| 15 |
+
COPY . .
|
| 16 |
+
|
| 17 |
+
# 6. Hugging Face exposes port 7860 by default
|
| 18 |
+
EXPOSE 7860
|
| 19 |
+
|
| 20 |
+
# 7. Start the Flask server using Gunicorn (production-ready)
|
| 21 |
+
CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "120", "server:app"]
|