Skip to content

Commit 49a8f0f

Browse files
committed
Fixed dockerfile?
1 parent 317c1aa commit 49a8f0f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ ARG WORKDIR
1313
WORKDIR $WORKDIR
1414
RUN groupadd --gid $USER_GID $USERNAME
1515
RUN useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
16-
COPY pyproject.toml uv.lock ./
1716
RUN apt-get update -y
1817
# install rust
1918
RUN apt-get install -y curl
@@ -22,12 +21,14 @@ ENV PATH="/root/.cargo/bin:${PATH}"
2221
# install prerequisites
2322
RUN apt-get install -y build-essential libssl-dev enchant-2 hunspell-ru hunspell-es hunspell-de-de hunspell-fr hunspell-pt-pt
2423
RUN 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
2930
RUN uv cache clean
30-
RUN pip uninstall -y uv pip setuptools
31+
RUN pip uninstall -y pip setuptools
3132
RUN rustup self uninstall -y
3233
RUN apt-get remove -y build-essential libssl-dev gcc curl
3334
RUN apt-get clean autoclean
@@ -45,5 +46,6 @@ WORKDIR $WORKDIR
4546
COPY --from=builder / /
4647
COPY . $WORKDIR
4748
USER $USERNAME
49+
ENV PATH="$WORKDIR/.venv/bin:$PATH"
4850
ENV SPELLCHECK_ENABLE_CORS=false
4951
CMD ["python", "-m", "whole_app"]

0 commit comments

Comments
 (0)