VLM-playground / Dockerfile
trevorpfiz
first commit
b42e995
raw
history blame
998 Bytes
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
WORKDIR /app
# Enable bytecode compilation and copy mode for mounted volumes
ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy
# Install dependencies from lockfile using cache/bind mounts
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 \
uv sync --locked --no-install-project --no-dev
# Then, add the rest of the project source code and install it
# Installing separately from its dependencies allows optimal layer caching
COPY . /app
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked --no-dev
# Place executables in the environment at the front of the path
ENV PATH="/app/.venv/bin:$PATH"
# Reset entrypoint; don't invoke uv directly
ENTRYPOINT []
EXPOSE 7860
ENV GRADIO_SERVER_NAME="0.0.0.0"
ENV GRADIO_SERVER_PORT="7860"
# Default command
CMD ["uv", "run", "python", "-m", "vlm_playground.app"]