Skip to content

Commit

Permalink
fix: env
Browse files Browse the repository at this point in the history
  • Loading branch information
a5chin committed Aug 26, 2024
1 parent 7b46b18 commit 6b12c26
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
9 changes: 6 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@ RUN sh /uv-installer.sh


FROM mcr.microsoft.com/vscode/devcontainers/base:bookworm

ENV CARGO_HOME="/opt/.cargo/bin"
ENV PATH="$CARGO_HOME/:$PATH"
COPY --from=builder /root/.cargo/bin/uv $CARGO_HOME/uv

ENV PYTHONUNBUFFERED=True
ENV UV_LINK_MODE=copy

WORKDIR /opt

COPY --from=builder /root/.cargo/bin/uv $CARGO_HOME/uv
COPY ./.python-version ./
RUN uv python pin "$(cat .python-version)"

ENV PYTHONUNBUFFERED=True
RUN uv python pin "$(cat .python-version)"

RUN chown -R vscode $CARGO_HOME
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}
}
},
"postCreateCommand": "uv sync",
"postCreateCommand": "uv sync --dev",
"postStartCommand": "uv run pre-commit install",
"remoteUser": "vscode"
}
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ ARG VARIANT=3.12
FROM python:${VARIANT} AS builder

ENV PYTHONDONTWRITEBYTECODE=True
ENV UV_LINK_MODE=copy

WORKDIR /opt

COPY pyproject.toml uv.lock ./

# hadolint ignore=DL3013,DL3042
RUN pip install --upgrade pip && \
pip install uv && \
uv sync --frozen


FROM python:${VARIANT}-slim
COPY --from=builder /usr/local/lib/python*/site-packages /usr/local/lib/python*/site-packages

Expand Down

0 comments on commit 6b12c26

Please sign in to comment.