Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +4 -19
Dockerfile
CHANGED
|
@@ -1,30 +1,15 @@
|
|
| 1 |
-
|
| 2 |
-
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
# Install system dependencies for OpenCV
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
ffmpeg \
|
| 9 |
-
libsm6 \
|
| 10 |
-
libxext6 \
|
| 11 |
-
git
|
| 12 |
|
| 13 |
-
# Set the working directory
|
| 14 |
WORKDIR /app
|
| 15 |
|
| 16 |
-
# Copy the requirements file and install dependencies
|
| 17 |
COPY requirements.txt .
|
| 18 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
-
# Copy your application code
|
| 21 |
COPY . .
|
| 22 |
|
| 23 |
-
# Download the YOLOv8 model (alternatively, ensure it's copied with your app)
|
| 24 |
-
RUN python -c "from ultralytics import YOLO; YOLO('yolov8n.pt')"
|
| 25 |
-
|
| 26 |
-
# Expose the port Hugging Face Spaces expects
|
| 27 |
EXPOSE 7860
|
| 28 |
-
|
| 29 |
-
# Command to run your Flask app with Gunicorn
|
| 30 |
-
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
|
|
|
| 2 |
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y \
|
| 4 |
+
ffmpeg libsm6 libxext6 libglib2.0-0 \
|
| 5 |
+
&& apt-get clean
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
|
|
|
| 7 |
WORKDIR /app
|
| 8 |
|
|
|
|
| 9 |
COPY requirements.txt .
|
| 10 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
|
|
|
|
| 12 |
COPY . .
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
EXPOSE 7860
|
| 15 |
+
CMD ["python", "app.py"]
|
|
|
|
|
|