Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ FROM python:3.11 AS builder
WORKDIR /build
COPY . .

RUN pip install .
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential gcc python3-dev pkg-config && \
rm -rf /var/lib/apt/lists/* && \
pip install --upgrade pip setuptools wheel build

RUN python3 setup.py sdist && \
pip install dist/*.tar.gz --target /install
RUN python -m build && \
pip install dist/*.tar.gz --prefix=/install

# minimal runtime image
# runtime stage
FROM python:3.11-slim AS runtime

COPY --from=builder /install /usr/local/lib/python3.11/site-packages
# copy installed Python libs + CLI scripts
COPY --from=builder /install /usr/local

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

Expand Down