Spaces:
Runtime error
Runtime error
File size: 1,352 Bytes
47b998b 2a28594 1a6537c 2a28594 47b998b 2a28594 |
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
FROM python:3.13@sha256:28f60ab75da2183870846130cead1f6af30162148d3238348f78f89cf6160b5d AS builder
SHELL ["/bin/bash", "-c"]
ENV UV_LINK_MODE=copy \
UV_COMPILE_BYTECODE=1 \
UV_PYTHON_DOWNLOADS=0
COPY --from=ghcr.io/astral-sh/uv:latest@sha256:2fd1b38e3398a256d6af3f71f0e2ba6a517b249998726a64d8cfbe55ab34af5e \
/uv /uvx /bin/
WORKDIR /app
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
--mount=type=bind,source=README.md,target=README.md \
uv sync --no-install-project --no-dev --locked --no-editable
COPY . /app
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --no-dev --locked --no-editable
FROM python:3.13-slim@sha256:6544e0e002b40ae0f59bc3618b07c1e48064c4faed3a15ae2fbd2e8f663e8283 AS production
SHELL ["/bin/bash", "-c"]
ENV GRADIO_SERVER_PORT=7860 \
GRADIO_SERVER_NAME=0.0.0.0
RUN groupadd app && \
useradd -m -g app -s /bin/bash app && \
apt-get update > /dev/null && \
apt-get install -y --no-install-recommends curl > /dev/null && \
apt-get clean > /dev/null && \
rm -rf /var/lib/apt/lists/*
WORKDIR /home/app
COPY --from=builder --chown=app:app --chmod=555 /app/.venv /app/.venv
USER app
EXPOSE ${GRADIO_SERVER_PORT}
CMD ["/app/.venv/bin/chattr"]
|