@@ -4,32 +4,40 @@ ARG PYTHON_VERSION=3.12
44FROM python:${PYTHON_VERSION} AS developer
55
66# Add any system dependencies for the developer/build environment here
7- RUN apt-get update && apt upgrade -y && rm -rf /var/lib/apt/lists/*
8- # Install PDM using the official installer script
9- RUN curl -LsSf https://astral.sh/uv/install.sh | sh
10- RUN wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq \
11- && chmod +x /usr/bin/yq
7+ RUN apt-get update && apt-get install -y --no-install-recommends \
8+ graphviz vim \
9+ && rm -rf /var/lib/apt/lists/*
10+ # Install uv using the official installer script
11+ RUN curl -LsSf https://astral.sh/uv/install.sh | \
12+ env UV_INSTALL_DIR="/usr/local/bin" sh
13+ RUN wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq \
14+ && chmod +x /usr/local/bin/yq
15+
16+
17+ # Configure environment
18+ ENV UV_CHECK_UPDATE=false
19+ # Configure UV to use system Python
20+ # ENV UV_SYSTEM_PYTHON=1
21+
22+ # Creates virtual environment
23+ RUN uv venv --seed venv
24+ ENV VIRTUAL_ENV=/venv
25+ ENV PATH=$VIRTUAL_ENV/bin:$PATH
1226
1327# The build stage installs the context into the venv
1428FROM developer AS build
15- # install uv
16- RUN pip install -U uv
17- # disable update check
18- ENV UV_CHECK_UPDATE=false
19- # copy files
20- # * means it will only try to copy uv.lock if it exists already
21- COPY pyproject.toml uv.lock* README.md LICENSE /project/
22- COPY src/ /project/src
29+ COPY . /context
30+ WORKDIR /context
2331
2432# install dependencies and project into the local packages directory
25- WORKDIR /project
26- RUN uv sync --dev --no-editable
33+ RUN touch dev-requirements.txt && uv pip install -c dev-requirements.txt .
2734
2835# The runtime stage copies the built venv into a slim runtime container
2936FROM python:${PYTHON_VERSION}-slim AS runtime
3037# Add apt-get system dependecies for runtime here if needed
31- COPY --from=build /project/.venv/ /project/.venv
32- ENV PATH="/project/.venv/bin:$PATH"
38+ COPY --from=build /venv/ /venv/
39+ ENV VIRTUAL_ENV=/venv
40+ ENV PATH=$VIRTUAL_ENV/bin:$PATH
3341
3442# change this entrypoint if it is not the same as the repo
3543ENTRYPOINT ["phoebus-guibuilder" ]
0 commit comments