mirror of
https://github.com/meshtastic/python.git
synced 2026-06-02 04:34:51 -04:00
34 lines
1.1 KiB
Docker
34 lines
1.1 KiB
Docker
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
#
|
|
# Copyright (C) 2025 Olliver Schinagl <oliver@schinagl.nl>
|
|
|
|
ARG TARGET_VERSION="3.11-alpine"
|
|
ARG TARGET_ARCH="library"
|
|
|
|
FROM docker.io/${TARGET_ARCH}/python:${TARGET_VERSION}
|
|
|
|
WORKDIR /tmp/build
|
|
|
|
COPY . /tmp/build
|
|
|
|
RUN _poetry_venv_dir="$(mktemp -d -p "${TMPDIR:-/tmp}" 'poetry_venv.XXXXXX')" && \
|
|
apk add --no-cache libffi && \
|
|
apk add --no-cache --virtual .build-deps build-base libffi-dev && \
|
|
python -m 'venv' "${_poetry_venv_dir}" && \
|
|
"${_poetry_venv_dir}/bin/pip" install --no-cache-dir 'poetry' && \
|
|
"${_poetry_venv_dir}/bin/poetry" config --local virtualenvs.create false && \
|
|
"${_poetry_venv_dir}/bin/poetry" install --without dev --extras cli --extras tunnel --no-interaction --no-ansi && \
|
|
apk del .build-deps && \
|
|
addgroup -S meshtastic && \
|
|
adduser -S -G meshtastic -h /home/meshtastic meshtastic && \
|
|
rm -f -r "${_poetry_venv_dir}" && \
|
|
rm -f -r "/tmp/build"
|
|
|
|
COPY "./bin/container-entrypoint.sh" "/init"
|
|
RUN chmod 0755 /init
|
|
|
|
WORKDIR /home/meshtastic
|
|
USER meshtastic
|
|
|
|
ENTRYPOINT [ "/init" ]
|