Spaces:
Sleeping
Sleeping
Commit
·
3ce037b
1
Parent(s):
a17bbc5
Modified dockerfile
Browse files- Dockerfile +3 -14
Dockerfile
CHANGED
|
@@ -17,27 +17,16 @@ RUN if [ -d dist ]; then mv dist out; \
|
|
| 17 |
|
| 18 |
# ---------- Python runtime ----------
|
| 19 |
FROM python:3.11-slim
|
| 20 |
-
|
| 21 |
-
ENV PIP_NO_CACHE_DIR=1 \
|
| 22 |
-
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
| 23 |
-
PIP_ONLY_BINARY=:all: \
|
| 24 |
-
PYTHONUNBUFFERED=1 \
|
| 25 |
-
PORT=7860
|
| 26 |
-
|
| 27 |
-
# tools that some wheels rely on; tiny
|
| 28 |
-
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
|
| 29 |
|
| 30 |
WORKDIR /app
|
| 31 |
-
|
| 32 |
COPY requirements.txt ./
|
| 33 |
-
# +cpu index gives you a small CPU torch wheel; drop if you bring your own CUDA base
|
| 34 |
RUN python -m pip install --upgrade pip && \
|
| 35 |
pip install --extra-index-url https://download.pytorch.org/whl/cpu -r requirements.txt
|
| 36 |
|
| 37 |
-
# copy app after deps (better layer caching)
|
| 38 |
COPY backend/ ./backend/
|
| 39 |
-
|
|
|
|
| 40 |
|
| 41 |
EXPOSE 7860
|
| 42 |
-
HEALTHCHECK CMD curl -f http://localhost:${PORT}/health || exit 1
|
| 43 |
CMD ["uvicorn", "backend.api:api", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 17 |
|
| 18 |
# ---------- Python runtime ----------
|
| 19 |
FROM python:3.11-slim
|
| 20 |
+
ENV PIP_NO_CACHE_DIR=1 PYTHONUNBUFFERED=1 PORT=7860
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
WORKDIR /app
|
|
|
|
| 23 |
COPY requirements.txt ./
|
|
|
|
| 24 |
RUN python -m pip install --upgrade pip && \
|
| 25 |
pip install --extra-index-url https://download.pytorch.org/whl/cpu -r requirements.txt
|
| 26 |
|
|
|
|
| 27 |
COPY backend/ ./backend/
|
| 28 |
+
# copy built UI from the builder stage
|
| 29 |
+
COPY --from=ui-builder /app/ui/out ./ui/dist
|
| 30 |
|
| 31 |
EXPOSE 7860
|
|
|
|
| 32 |
CMD ["uvicorn", "backend.api:api", "--host", "0.0.0.0", "--port", "7860"]
|