diff --git a/.dockerignore b/.dockerignore index 5191144..1e29cf7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,12 +1,15 @@ -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 - - +app/meshtastic-matrix-relay/gui +app/meshtastic-matrix-relay/DEVELOPMENT.md +app/meshtastic-matrix-relay/mmrelay.iss +app/meshtastic-matrix-relay/example_plugins +app/meshtastic-matrix-relay/LICENSE +app/meshtastic-matrix-relay/README.md +app/meshtastic-matrix-relay/sample_config.yaml +app/meshtastic-matrix-relay/.gitignore +app/meshtastic-matrix-relay/.git +app/meshtastic-matrix-relay/.github +app/meshtastic-matrix-relay/.pyenv +app/meshtastic-matrix-relay/.vscode +app/meshtastic-matrix-relay/meshtastic.sqlite +app/meshtastic-matrix-relay/__pycache__/ +app/meshtastic-matrix-relay/plugins/__pycache__/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 36cbe09..3fc844a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "meshtastic-matrix-relay"] - path = node/meshtastic-matrix-relay + path = app/meshtastic-matrix-relay url = https://github.com/geoffwhittington/meshtastic-matrix-relay diff --git a/app/Dockerfile b/app/Dockerfile index ebbe80d..aaee002 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -9,3 +9,6 @@ RUN pip install -qq -r /home/mesh/app/requirements.txt --no-cache-dir RUN echo "export PATH=/home/mesh/.local/bin:\$PATH" >> /home/mesh/.bashrc COPY config.yaml . #ENTRYPOINT ["sh", "-c", "sleep 30 && python main.py"] + + + diff --git a/app/config.yaml b/app/config.yaml index 562ee45..4d0b05c 100644 --- a/app/config.yaml +++ b/app/config.yaml @@ -27,3 +27,4 @@ plugins: # Optional plugins active: true nodes: active: true + \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index fdb61c1..d2be07a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,4 +1,4 @@ -version: "3.7" +version: "3.8" services: mmrelaynode: build: node @@ -7,16 +7,13 @@ services: restart: unless-stopped user: "1000:1000" volumes: - - mesh:/home/mesh/node + - mesh:/home/mesh ports: - "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)"] - depends_on: - - mmrelayapp - + entrypoint: ["sh", "-c", "run.sh"] + mmrelayapp: build: app image: mmrelayapp:latest @@ -24,13 +21,15 @@ services: restart: unless-stopped user: "1000:1000" volumes: - - mesh:/home/mesh/app + - mesh:/home/mesh networks: - - mesh - entrypoint: ["sh", "-c", "sleep 30 && python main.py"] + - mesh + command: ["sh", "-c", "sleep 30"] + entrypoint: ["python3", "main.py"] volumes: mesh: + external: true networks: mesh: diff --git a/node/Dockerfile b/node/Dockerfile index 2842e06..6d6e37e 100644 --- a/node/Dockerfile +++ b/node/Dockerfile @@ -1,11 +1,13 @@ -FROM frolvlad/alpine-glibc:glibc-2.34 AS node +FROM alpine:3.18 AS node 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 +RUN mkdir /home/mesh/node +COPY run.sh /home/mesh/node/ +RUN chown mesh:mesh -R /home/mesh/node && chmod +x /home/mesh/node/run.sh +WORKDIR /home/mesh/node/ #ENTRYPOINT ["sh", "-c", "/usr/bin/meshtasticd -d /home/mesh/node -h 12345"] diff --git a/node/run.sh b/node/run.sh new file mode 100644 index 0000000..04333e3 --- /dev/null +++ b/node/run.sh @@ -0,0 +1,3 @@ +#!/bin/sh +HWID=$(grep 'hwid: "' /home/mesh/app/config.yaml) +/usr/bin/meshtasticd -d /home/mesh/node -h $HWID \ No newline at end of file