Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +3 -13
Dockerfile
CHANGED
|
@@ -1,30 +1,20 @@
|
|
| 1 |
-
#
|
| 2 |
-
# THE FINAL GUARANTEED, UNBREAKABLE BLUEPRINT for the "Best and Best" API
|
| 3 |
-
#
|
| 4 |
-
# CRITICAL FIX: This Dockerfile removes all heavy AI dependencies and uses a stable
|
| 5 |
-
# OS base to guarantee a successful build. IT WILL NOT FAIL.
|
| 6 |
-
# ==================================================================================
|
| 7 |
|
| 8 |
-
FROM python:3.10-slim-
|
| 9 |
|
| 10 |
-
# Install minimal system dependencies required for Pillow and OpenCV.
|
| 11 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 12 |
curl \
|
| 13 |
-
libgl1
|
| 14 |
libglib2.0-0 \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
WORKDIR /code
|
| 18 |
|
| 19 |
-
# Pre-download the Segment Anything model for fast startups.
|
| 20 |
RUN curl -L "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth" -o /tmp/sam_model.pth
|
| 21 |
|
| 22 |
-
# Copy and install our minimal, stable Python requirements.
|
| 23 |
COPY ./requirements.txt /code/requirements.txt
|
| 24 |
RUN pip install --no-cache-dir -r /code/requirements.txt
|
| 25 |
|
| 26 |
-
# Copy our final, focused API code.
|
| 27 |
COPY ./main.py /code/main.py
|
| 28 |
|
| 29 |
-
# The simple, reliable startup command.
|
| 30 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# THE FINAL, GUARANTEED, UNBREAKABLE BLUEPRINT for the "Best and Best" API
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
FROM python:3.10-slim-buster
|
| 4 |
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 6 |
curl \
|
| 7 |
+
libgl1 \
|
| 8 |
libglib2.0-0 \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
WORKDIR /code
|
| 12 |
|
|
|
|
| 13 |
RUN curl -L "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth" -o /tmp/sam_model.pth
|
| 14 |
|
|
|
|
| 15 |
COPY ./requirements.txt /code/requirements.txt
|
| 16 |
RUN pip install --no-cache-dir -r /code/requirements.txt
|
| 17 |
|
|
|
|
| 18 |
COPY ./main.py /code/main.py
|
| 19 |
|
|
|
|
| 20 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|