FROM ghcr.io/astral-sh/uv:python3.12-alpine

ENV PYTHONUNBUFFERED=1
ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy
ENV UV_PYTHON_CACHE_DIR=/root/.cache/uv/python

WORKDIR /feather

# Install dependencies
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=.python-version,target=.python-version \
	uv sync --locked --no-dev --no-install-project
ENV PATH="/feather/.venv/bin:$PATH"

# Install project
COPY . /feather
RUN --mount=type=cache,target=/root/.cache/uv \
	uv sync --locked --no-dev

ENTRYPOINT [ "feather" ]

