Skip to content

Commit 680d703

Browse files
committed
only copy, no install in runtime stage
Signed-off-by: iripiri <ikoester@eonerc.rwth-aachen.de>
1 parent 1b36d65 commit 680d703

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
99
WORKDIR /app
1010
COPY . .
1111

12-
RUN python -m build
12+
RUN python -m build && \
13+
pip install dist/*.tar.gz --prefix=/install
1314

1415
# runtime stage
1516
FROM python:3.11-slim AS runtime
@@ -19,8 +20,8 @@ ENV PYTHONUNBUFFERED=1 \
1920
PYTHONDONTWRITEBYTECODE=1 \
2021
PIP_NO_CACHE_DIR=1
2122

22-
COPY --from=builder /app/dist/*.tar.gz /tmp/
23-
RUN pip install /tmp/*.tar.gz && rm -rf /tmp/*
23+
# copy installed Python libs + CLI scripts
24+
COPY --from=builder /install /usr/local
2425

2526
COPY etc/*.json etc/*.yaml /etc/villas/controller/
2627
COPY villas-controller.service /etc/systemd/system/

0 commit comments

Comments
 (0)