1
0
Fork 0
mirror of https://codeberg.org/Reuh/feather.git synced 2025-10-27 10:09:32 +00:00

feat: improve Dockerfile to install dependencies in a separate layer

This commit is contained in:
Étienne Fildadut 2025-10-13 14:28:51 +02:00
parent 46f3d4f288
commit eee54c948c

View file

@ -2,12 +2,23 @@ FROM ghcr.io/astral-sh/uv:alpine3.22
ENV PYTHONUNBUFFERED=1 ENV PYTHONUNBUFFERED=1
ENV UV_COMPILE_BYTECODE=1 ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy
ENV UV_PYTHON_CACHE_DIR=/root/.cache/uv/python
WORKDIR /feather WORKDIR /feather
COPY . /feather
RUN uv sync --locked --no-dev && \ # Install dependencies
uv cache clean 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" 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" ] ENTRYPOINT [ "feather" ]