@@ -13,7 +13,6 @@ ARG WORKDIR
1313WORKDIR $WORKDIR
1414RUN groupadd --gid $USER_GID $USERNAME
1515RUN useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
16- COPY pyproject.toml uv.lock ./
1716RUN apt-get update -y
1817# install rust
1918RUN apt-get install -y curl
@@ -22,12 +21,14 @@ ENV PATH="/root/.cargo/bin:${PATH}"
2221# install prerequisites
2322RUN apt-get install -y build-essential libssl-dev enchant-2 hunspell-ru hunspell-es hunspell-de-de hunspell-fr hunspell-pt-pt
2423RUN pip install -U pip uv
25- # install necessary packages from lockfile
26- RUN uv sync --locked --no-install-project
24+ # Install the project's dependencies using the lockfile and settings
25+ RUN --mount=type=cache,target=/root/.cache/uv \
26+ --mount=type=bind,source=uv.lock,target=uv.lock \
27+ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
28+ uv sync --locked --no-install-project
2729# massive cleanup
28- RUN rm uv.lock
2930RUN uv cache clean
30- RUN pip uninstall -y uv pip setuptools
31+ RUN pip uninstall -y pip setuptools
3132RUN rustup self uninstall -y
3233RUN apt-get remove -y build-essential libssl-dev gcc curl
3334RUN apt-get clean autoclean
@@ -45,5 +46,6 @@ WORKDIR $WORKDIR
4546COPY --from=builder / /
4647COPY . $WORKDIR
4748USER $USERNAME
49+ ENV PATH="$WORKDIR/.venv/bin:$PATH"
4850ENV SPELLCHECK_ENABLE_CORS=false
4951CMD ["python" , "-m" , "whole_app" ]
0 commit comments