@@ -10,25 +10,25 @@ RUN curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm
1010RUN wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq \
1111 && chmod +x /usr/bin/yq
1212
13- COPY . ./
14- COPY src/phoebus_guibuilder ./phoebus_guibuilder
15- RUN touch README.md
16-
17- # # Set up a virtual environment and put it in PATH
18- # RUN python -m venv /venv
19- # ENV PATH=/venv/bin:$PATH
20-
2113# # The build stage installs the context into the venv
22- # FROM developer AS build
23- # COPY . /context
24- # WORKDIR /context
25- # RUN touch dev-requirements.txt && pip install -c dev-requirements.txt .
14+ FROM developer AS build
15+ # install PDM
16+ RUN pip install -U pdm
17+ # disable update check
18+ ENV PDM_CHECK_UPDATE=false
19+ # copy files
20+ COPY pyproject.toml pdm.lock README.md /project/
21+ COPY src/ /project/src
22+
23+ # install dependencies and project into the local packages directory
24+ WORKDIR /project
25+ RUN pdm install --check --prod --no-editable
2626
27- # # The runtime stage copies the built venv into a slim runtime container
28- # FROM python:${PYTHON_VERSION}-slim AS runtime
29- # # Add apt-get system dependecies for runtime here if needed
30- # COPY --from=build / venv/ /venv/
31- # ENV PATH=/ venv/bin:$PATH
27+ # The runtime stage copies the built venv into a slim runtime container
28+ FROM python:${PYTHON_VERSION}-slim AS runtime
29+ # Add apt-get system dependecies for runtime here if needed
30+ COPY --from=builder /project/. venv/ /project/.venv
31+ ENV PATH="/project/. venv/bin:$PATH"
3232
3333# change this entrypoint if it is not the same as the repo
3434ENTRYPOINT ["phoebus-guibuilder" ]
0 commit comments