Skip to content

Commit

Permalink
chore: improve docker caching
Browse files Browse the repository at this point in the history
  • Loading branch information
monosans committed Nov 4, 2024
1 parent ce0ceed commit 5c9de73
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# syntax=docker/dockerfile:1

FROM docker.io/python:3.12-slim-bookworm AS python-base-stage

ENV \
Expand All @@ -20,8 +22,8 @@ ENV \

RUN --mount=from=ghcr.io/astral-sh/uv,source=/uv,target=/bin/uv \
--mount=type=cache,target=/root/.cache/uv,sharing=locked \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=source=pyproject.toml,target=pyproject.toml \
--mount=source=uv.lock,target=uv.lock \
uv sync --extra non-termux --no-dev --no-install-project --frozen


Expand All @@ -36,7 +38,7 @@ RUN apt-get update \
&& mkdir -p /home/app/.cache/proxy_scraper_checker \
&& chown app:app /home/app/.cache/proxy_scraper_checker

COPY --chown=app:app --from=python-build-stage /app/.venv /app/.venv
COPY --from=python-build-stage --chown=app:app --link /app/.venv /app/.venv

ENV PATH="/app/.venv/bin:$PATH"

Expand Down

0 comments on commit 5c9de73

Please sign in to comment.