Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +27 -25
Dockerfile
CHANGED
|
@@ -1,25 +1,27 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
#
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
# Bust the cache when you change this number:
|
| 4 |
+
ARG CACHEBUST=2
|
| 5 |
+
|
| 6 |
+
# Minimal system libs (glib needed by many wheels; libgl fixes GUI builds if they ever slip in)
|
| 7 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 8 |
+
libgl1 libglib2.0-0 libsm6 libxext6 libxrender1 && \
|
| 9 |
+
rm -rf /var/lib/apt/lists/*
|
| 10 |
+
|
| 11 |
+
WORKDIR /code
|
| 12 |
+
|
| 13 |
+
COPY requirements.txt .
|
| 14 |
+
|
| 15 |
+
# Clean install: upgrade tools, remove any GUI OpenCV if cached, then install headless deps
|
| 16 |
+
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
|
| 17 |
+
pip uninstall -y opencv-python opencv-contrib-python || true && \
|
| 18 |
+
pip install --no-cache-dir -r requirements.txt
|
| 19 |
+
|
| 20 |
+
COPY app ./app
|
| 21 |
+
|
| 22 |
+
RUN mkdir -p /code/app/static/processed
|
| 23 |
+
|
| 24 |
+
ENV PORT=7860
|
| 25 |
+
|
| 26 |
+
CMD ["bash","-lc","python -m uvicorn app.main:app --host 0.0.0.0 --port $PORT"]
|
| 27 |
+
|