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