Spaces:
Runtime error
Runtime error
| FROM node:22-bookworm-slim AS frontend-builder | |
| WORKDIR /app/studio/frontend | |
| # Install dependencies first for better layer caching. | |
| COPY studio/frontend/package.json studio/frontend/bun.lock ./ | |
| RUN npm install -g npm@latest && npm install | |
| COPY studio/frontend/ ./ | |
| RUN npm run build | |
| FROM python:3.12-slim AS runtime | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| HF_HOME=/data/.huggingface \ | |
| PORT=7860 | |
| WORKDIR /app | |
| # Build/runtime dependencies needed by the Unsloth stack. | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| bash \ | |
| build-essential \ | |
| cmake \ | |
| curl \ | |
| ffmpeg \ | |
| git \ | |
| libsndfile1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Python dependencies in the same order as setup.sh. | |
| COPY studio/backend/requirements /app/studio/backend/requirements | |
| RUN set -eux; \ | |
| REQ_ROOT=/app/studio/backend/requirements; \ | |
| SINGLE_ENV_CONSTRAINTS="$REQ_ROOT/single-env/constraints.txt"; \ | |
| pip install --upgrade pip; \ | |
| pip install --no-cache-dir -c "$SINGLE_ENV_CONSTRAINTS" -r "$REQ_ROOT/base.txt"; \ | |
| pip install --no-cache-dir -c "$SINGLE_ENV_CONSTRAINTS" -r "$REQ_ROOT/extras.txt"; \ | |
| pip install --force-reinstall --no-cache-dir -c "$SINGLE_ENV_CONSTRAINTS" -r "$REQ_ROOT/overrides.txt"; \ | |
| pip install --no-deps --no-cache-dir -r "$REQ_ROOT/triton-kernels.txt"; \ | |
| LLAMA_CPP_DST="$(pip show unsloth-zoo | awk '/^Location:/{print $2}')/unsloth_zoo/llama_cpp.py"; \ | |
| curl -fsSL "https://raw.githubusercontent.com/unslothai/unsloth-zoo/refs/heads/main/unsloth_zoo/llama_cpp.py" -o "$LLAMA_CPP_DST"; \ | |
| VISION_DST="$(pip show unsloth | awk '/^Location:/{print $2}')/unsloth/models/vision.py"; \ | |
| curl -fsSL "https://raw.githubusercontent.com/unslothai/unsloth/80e0108a684c882965a02a8ed851e3473c1145ab/unsloth/models/vision.py" -o "$VISION_DST"; \ | |
| pip install --no-cache-dir -c "$SINGLE_ENV_CONSTRAINTS" -r "$REQ_ROOT/studio.txt"; \ | |
| pip install --no-cache-dir -c "$SINGLE_ENV_CONSTRAINTS" -r "$REQ_ROOT/single-env/data-designer-deps.txt"; \ | |
| pip install --no-cache-dir --no-deps -c "$SINGLE_ENV_CONSTRAINTS" -r "$REQ_ROOT/single-env/data-designer.txt"; \ | |
| python "$REQ_ROOT/single-env/patch_metadata.py"; \ | |
| pip check | |
| COPY . /app | |
| COPY --from=frontend-builder /app/studio/frontend/dist /app/studio/frontend/dist | |
| RUN chmod +x /app/docker/start.sh | |
| EXPOSE 7860 | |
| CMD ["/app/docker/start.sh"] | |