diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5191144 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,12 @@ +meshtastic-matrix-relay/gui +meshtastic-matrix-relay/DEVELOPMENT.md +meshtastic-matrix-relay/mmrelay.iss +meshtastic-matrix-relay/example_plugins +meshtastic-matrix-relay/LICENSE +meshtastic-matrix-relay/README.md +meshtastic-matrix-relay/sample_config.yaml +meshtastic-matrix-relay/.gitignore +meshtastic-matrix-relay/.git +meshtastic-matrix-relay/.github + + diff --git a/Dockerfile_app b/Dockerfile_app index dbffda6..947df62 100644 --- a/Dockerfile_app +++ b/Dockerfile_app @@ -1,21 +1,11 @@ FROM python:3.11-slim-bookworm - +LABEL "website"="https://github.com/mate-dev/mmrelaynode" RUN groupadd -g 1000 mesh && useradd -ml -u 1000 -g 1000 -s /bin/bash mesh - RUN pip install --upgrade pip -qq - USER mesh - -VOLUME /home/mesh -COPY ./meshtastic-matrix-relay /home/mesh/app - +WORKDIR /home/mesh/app +COPY meshtastic-matrix-relay /home/mesh/app +COPY config.yaml . RUN pip install -qq -r /home/mesh/app/requirements.txt - -USER root -RUN chown -R mesh:mesh /mnt -#RUN bash -c "for f in /home/mesh/{*,.*}; do cp -r "$f" /mnt/; done" -COPY ./config.yaml /mnt/app/config.yaml -RUN chown -R mesh:mesh /mnt -USER mesh - -WORKDIR /home/mesh +RUN echo "export PATH=/home/mesh/.local/bin:\$PATH" >> /home/mesh/.bashrc +#ENTRYPOINT ["sh", "-c", "sleep 30 && python main.py"] diff --git a/Dockerfile_node b/Dockerfile_node index 5210262..dce6c70 100644 --- a/Dockerfile_node +++ b/Dockerfile_node @@ -1,11 +1,12 @@ FROM frolvlad/alpine-glibc:glibc-2.34 - +LABEL "website"="https://github.com/mate-dev/mmrelaynode" RUN apk --update add --no-cache g++ shadow && \ groupadd -g 1000 mesh && useradd -ml -u 1000 -g 1000 mesh - ADD https://github.com/mate-dev/mmrelaynode/releases/latest/download/meshtasticd_linux_amd64 /usr/bin/meshtasticd RUN chmod +x /usr/bin/meshtasticd - USER mesh +RUN mkdir /home/mesh/node +#ENTRYPOINT ["sh", "-c", "/usr/bin/meshtasticd -d /home/mesh/node -h 12345"] + + -WORKDIR /home/mesh diff --git a/config.yaml b/config.yaml index a844eeb..3f1d0dc 100644 --- a/config.yaml +++ b/config.yaml @@ -15,6 +15,7 @@ meshtastic: host: "localhost" # Do not change! meshnet_name: "Your Meshnet Name" # This is displayed in full on Matrix, but is truncated when sent to a Meshnet broadcast_enabled: true + hwid: "12345" # Change to your Hardware ID logging: level: "info" diff --git a/docker-compose.yaml b/docker-compose.yaml index 36fba9b..9b4533a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,37 +1,31 @@ -version: '3' +version: "3.7" services: - mmrelayapp: - build: - context: . - dockerfile: Dockerfile_app - image: mmrelayapp:latest - container_name: mmrelay-app - restart: unless-stopped - user: 1000:1000 - volumes: - - mesh_volume:/home/mesh - networks: - - mesh_net - command: sh -c 'echo "export PATH=/home/mesh/.local/bin:\$PATH" >> /home/mesh/.bashrc' - entrypoint: ["sh", "-c", "sleep 30 && python app/main.py"] - mmrelaynode: - build: - context: . - dockerfile: Dockerfile_node image: mmrelaynode:latest container_name: mmrelay-node restart: unless-stopped - user: 1000:1000 - networks: - - mesh_net - # volumes: - # - mesh_volume:/home/mesh + user: "1000:1000" + volumes: + - mesh:/home/mesh ports: - - 4403:4403 - entrypoint: ["sh", "-cx", "/usr/bin/meshtasticd -d /home/mesh --hwid '12345'"] #change to your own hardware id + - "4403:4403" + networks: + - mesh + entrypoint: ["sh", "-c", "/usr/bin/meshtasticd -d /home/mesh/node -h 1234"] +# entrypoint: ["sh", "-c", "/usr/bin/meshtasticd -d /home/mesh/node -h $(grep -Po 'hwid: "\K[^"]+' /home/mesh/app/config.yaml)"] + mmrelayapp: + image: mmrelayapp:latest + container_name: mmrelay-app + restart: unless-stopped + user: "1000:1000" + volumes: + - mesh:/home/mesh + networks: + - mesh + entrypoint: ["sh", "-c", "sleep 30 && python main.py"] + +volumes: + mesh: networks: - mesh_net: -volumes: - mesh_volume: + mesh: