-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (23 loc) · 1.05 KB
/
Dockerfile
File metadata and controls
30 lines (23 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM australia-southeast1-docker.pkg.dev/analysis-runner/images/driver:latest
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Set up working directory for the project
WORKDIR /cpg-flow
# Enable bytecode compilation
ENV UV_COMPILE_BYTECODE=1
# Copy from the cache instead of linking since it's a mounted volume
ENV UV_LINK_MODE=copy
# Install the project's dependencies using the lockfile and settings
# Copy `pyproject.toml` and `uv.lock` into `/cpg-flow` explicitly
COPY pyproject.toml uv.lock /cpg-flow/
# Install the project's dependencies using the lockfile and settings
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-project
# Add the project source code from src/cpg-flow
ADD . /cpg-flow
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen
# Place executables in the environment at the front of the path
ENV PATH="/cpg-flow/.venv/bin:$PATH"
ENV PYTHONPATH="/cpg-flow:${PYTHONPATH}"