Skip to content

Commit

Permalink
fix: install uv from installer in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuswinger committed Sep 3, 2024
1 parent 6f29e30 commit c73e069
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ jobs:
- uses: actions/checkout@master

- name: Set up uv
run: |
curl -LsSf https://astral.sh/uv/0.3.2/install.sh | sh
run: curl -LsSf https://astral.sh/uv/0.4.3/install.sh | sh

- name: Set up python
uses: actions/setup-python@v5
Expand All @@ -41,7 +40,7 @@ jobs:
uv-${{ runner.os }}
- name: Install deps
run: cd api && uv sync --dev --locked
run: cd api && uv sync --all-extras --locked

- name: Run pre-commit
run: cd api && uv run pre-commit run --all-files
Expand Down
9 changes: 7 additions & 2 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ ENV PYTHONPATH=/code
ENV VIRTUAL_ENV=/code/.venv
ENV PATH="/code/.venv/bin:$PATH"

COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
# Install uv: The installer requires curl (and certificates) to download the release archive
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates
ADD https://astral.sh/uv/0.4.3/install.sh /uv-installer.sh
RUN sh /uv-installer.sh && rm /uv-installer.sh
# Ensure the installed binary is on the `PATH`
ENV PATH="/root/.cargo/bin/:$PATH"

COPY pyproject.toml pyproject.toml
COPY uv.lock uv.lock


FROM base as development
RUN uv sync --frozen --no-cache --dev
RUN uv sync --frozen --no-cache --all-extras
WORKDIR /code/src
COPY src .
USER 1000
Expand Down

0 comments on commit c73e069

Please sign in to comment.