Update Dockerfile
Browse files- Dockerfile +37 -37
Dockerfile
CHANGED
|
@@ -1,37 +1,37 @@
|
|
| 1 |
-
FROM python:3.10-slim
|
| 2 |
-
|
| 3 |
-
WORKDIR /app
|
| 4 |
-
|
| 5 |
-
# Install system dependencies for OpenCV and other libraries
|
| 6 |
-
RUN apt-get update && apt-get install -y \
|
| 7 |
-
git \
|
| 8 |
-
libgl1
|
| 9 |
-
libglib2.0-0 \
|
| 10 |
-
libsm6 \
|
| 11 |
-
libxext6 \
|
| 12 |
-
libxrender-dev \
|
| 13 |
-
libgomp1 \
|
| 14 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
-
|
| 16 |
-
# Copy requirements first for better caching
|
| 17 |
-
COPY requirements.txt .
|
| 18 |
-
|
| 19 |
-
# Install Python dependencies
|
| 20 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
-
|
| 22 |
-
# Copy application files
|
| 23 |
-
COPY config.py .
|
| 24 |
-
COPY model_manager.py .
|
| 25 |
-
COPY inference.py .
|
| 26 |
-
COPY app.py .
|
| 27 |
-
COPY utils/ utils/
|
| 28 |
-
|
| 29 |
-
# Expose Hugging Face Spaces default port
|
| 30 |
-
EXPOSE 7860
|
| 31 |
-
|
| 32 |
-
# Health check
|
| 33 |
-
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
| 34 |
-
CMD python -c "import requests; requests.get('http://localhost:7860/health')"
|
| 35 |
-
|
| 36 |
-
# Run the FastAPI application
|
| 37 |
-
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# Install system dependencies for OpenCV and other libraries
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
git \
|
| 8 |
+
libgl1 \
|
| 9 |
+
libglib2.0-0 \
|
| 10 |
+
libsm6 \
|
| 11 |
+
libxext6 \
|
| 12 |
+
libxrender-dev \
|
| 13 |
+
libgomp1 \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
+
|
| 16 |
+
# Copy requirements first for better caching
|
| 17 |
+
COPY requirements.txt .
|
| 18 |
+
|
| 19 |
+
# Install Python dependencies
|
| 20 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
+
|
| 22 |
+
# Copy application files
|
| 23 |
+
COPY config.py .
|
| 24 |
+
COPY model_manager.py .
|
| 25 |
+
COPY inference.py .
|
| 26 |
+
COPY app.py .
|
| 27 |
+
COPY utils/ utils/
|
| 28 |
+
|
| 29 |
+
# Expose Hugging Face Spaces default port
|
| 30 |
+
EXPOSE 7860
|
| 31 |
+
|
| 32 |
+
# Health check
|
| 33 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
| 34 |
+
CMD python -c "import requests; requests.get('http://localhost:7860/health')"
|
| 35 |
+
|
| 36 |
+
# Run the FastAPI application
|
| 37 |
+
CMD ["python", "app.py"]
|