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:
parent
46f3d4f288
commit
eee54c948c
1 changed files with 14 additions and 3 deletions
17
Dockerfile
17
Dockerfile
|
|
@ -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" ]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue