remove irrelevant dialout user, add docker-compose device mount documentation

This commit is contained in:
Laura Batalha 2025-05-16 15:01:27 +01:00
parent ada43e799b
commit 9c36d55518
No known key found for this signature in database
GPG key ID: FF87260D8C08DA64
3 changed files with 14 additions and 8 deletions

View file

@ -2,23 +2,23 @@ ARG python_version=3.13
FROM python:${python_version}-alpine AS build
RUN apk add --no-cache build-base linux-headers libffi-dev libressl-dev cargo
#RUN apk add --no-cache build-base linux-headers libffi-dev libressl-dev cargo
ENV PIP_ROOT_USER_ACTION=ignore
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1
RUN pip install rns
FROM python:${python_version}-alpine
ARG python_version
#FROM python:${python_version}-alpine
#ARG python_version
# Only copy the necessary files from the build stage, to improve layer efficiency
COPY --from=build /usr/local/bin/rn* /usr/local/bin/
COPY --from=build /usr/local/lib/python${python_version}/site-packages/ /usr/local/lib/python${python_version}/site-packages/
#COPY --from=build /usr/local/bin/rn* /usr/local/bin/
#COPY --from=build /usr/local/lib/python${python_version}/site-packages/ /usr/local/lib/python${python_version}/site-packages/
RUN mkdir /config
RUN addgroup -S rns --gid 1000 && adduser -S rns --uid 1000 -G rns dialout
RUN addgroup -S rns --gid 1000 && adduser -S rns --uid 1000 -G rns
RUN chown rns:rns /config
USER rns:rns

View file

@ -20,7 +20,7 @@ COPY --from=build /usr/local/lib/python${python_version}/site-packages/ /usr/loc
RUN mkdir /config
RUN addgroup -S rns --gid 1000 && adduser -S rns --uid 1000 -G rns dialout
RUN addgroup -S rns --gid 1000 && adduser -S rns --uid 1000 -G rns
RUN chown rns:rns /config
USER rns:rns

View file

@ -3,11 +3,17 @@ services:
container_name: reticulum
image: ghcr.io/markqvist/reticulum:latest
restart: unless-stopped
# You can mount devices, make sure to add the user to the group id
# which has rw access to the device on the host
devices:
- /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0:/dev/ttyACM0
group_add:
- 986
# Mount the config directory on the host in the same location as the docker-compose.yml
# to allow data persistency
volumes:
- ./config:/config:rw
# Define ports to expose, for example a TCP Listener
# Define ports to expose, for example a default TCP Listener
ports:
- "4242:4242/tcp"
networks: