Update Dockerfile
Browse files- Dockerfile +2 -6
Dockerfile
CHANGED
|
@@ -2,7 +2,7 @@ FROM python:3.10-slim
|
|
| 2 |
|
| 3 |
WORKDIR /code
|
| 4 |
|
| 5 |
-
# Install system dependencies for OpenCV
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
libglib2.0-0 \
|
| 8 |
libsm6 \
|
|
@@ -12,22 +12,18 @@ RUN apt-get update && apt-get install -y \
|
|
| 12 |
libxcb1 \
|
| 13 |
libxcb-shm0 \
|
| 14 |
libxcb-render0 \
|
|
|
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
-
# Copy and install Python dependencies
|
| 18 |
COPY requirements.txt /code/requirements.txt
|
| 19 |
|
| 20 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 21 |
pip install --no-cache-dir -r /code/requirements.txt
|
| 22 |
|
| 23 |
-
# Copy application code
|
| 24 |
COPY app.py /code/app.py
|
| 25 |
|
| 26 |
-
# Create cache directory for HuggingFace Hub
|
| 27 |
RUN mkdir -p /tmp/huggingface && chmod 777 /tmp/huggingface
|
| 28 |
|
| 29 |
-
# Expose HuggingFace Spaces default port
|
| 30 |
EXPOSE 7860
|
| 31 |
|
| 32 |
-
# Start the FastAPI server
|
| 33 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /code
|
| 4 |
|
| 5 |
+
# Install system dependencies for OpenCV (including libGL)
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
libglib2.0-0 \
|
| 8 |
libsm6 \
|
|
|
|
| 12 |
libxcb1 \
|
| 13 |
libxcb-shm0 \
|
| 14 |
libxcb-render0 \
|
| 15 |
+
libgl1 \
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
|
|
|
| 18 |
COPY requirements.txt /code/requirements.txt
|
| 19 |
|
| 20 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 21 |
pip install --no-cache-dir -r /code/requirements.txt
|
| 22 |
|
|
|
|
| 23 |
COPY app.py /code/app.py
|
| 24 |
|
|
|
|
| 25 |
RUN mkdir -p /tmp/huggingface && chmod 777 /tmp/huggingface
|
| 26 |
|
|
|
|
| 27 |
EXPOSE 7860
|
| 28 |
|
|
|
|
| 29 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|