Spaces:
Paused
Paused
muhammadhamza-stack
commited on
Commit
·
0c45230
1
Parent(s):
8ea59e4
update dockerfile
Browse files- Dockerfile +3 -9
Dockerfile
CHANGED
|
@@ -1,31 +1,25 @@
|
|
| 1 |
-
# HF Spaces compatible base image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
# Prevent Python from writing .pyc files
|
| 5 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 6 |
ENV PYTHONUNBUFFERED=1
|
| 7 |
|
| 8 |
-
# Set working directory
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
-
#
|
| 12 |
RUN apt-get update && apt-get install -y \
|
|
|
|
|
|
|
| 13 |
git \
|
| 14 |
curl \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
-
# Copy requirements first (better Docker caching)
|
| 18 |
COPY requirements.txt .
|
| 19 |
|
| 20 |
-
# Upgrade pip and install dependencies
|
| 21 |
RUN pip install --upgrade pip \
|
| 22 |
&& pip install --no-cache-dir -r requirements.txt
|
| 23 |
|
| 24 |
-
# Copy the rest of the application
|
| 25 |
COPY . .
|
| 26 |
|
| 27 |
-
# Hugging Face Spaces uses port 7860
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
-
# Start the app
|
| 31 |
CMD ["python", "app.py"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
|
|
|
| 3 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 4 |
ENV PYTHONUNBUFFERED=1
|
| 5 |
|
|
|
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
+
# Install system dependencies REQUIRED for OpenCV / Ultralytics
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
+
libgl1 \
|
| 11 |
+
libglib2.0-0 \
|
| 12 |
git \
|
| 13 |
curl \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
|
|
|
| 16 |
COPY requirements.txt .
|
| 17 |
|
|
|
|
| 18 |
RUN pip install --upgrade pip \
|
| 19 |
&& pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
|
|
|
| 21 |
COPY . .
|
| 22 |
|
|
|
|
| 23 |
EXPOSE 7860
|
| 24 |
|
|
|
|
| 25 |
CMD ["python", "app.py"]
|