From e0ca50afc87b8bd82c2e395babfc6f9b24f88ea6 Mon Sep 17 00:00:00 2001 From: suymur Date: Fri, 20 Feb 2026 11:23:16 +0100 Subject: [PATCH 1/4] Add Docker Compose support for simplified deployment - Add docker-compose.yaml with service configuration - Support for multiple transport options (TCP, Serial, BLE) - Configure standard port mapping (8000:8000) - Use named volume for portable data persistence - Update Dockerfile to use npm install for better compatibility Co-Authored-By: Claude Sonnet 4.5 --- Dockerfile | 2 +- docker-compose.yaml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yaml diff --git a/Dockerfile b/Dockerfile index 5ab2f49..7d8358e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM node:20-slim AS frontend-builder WORKDIR /build COPY frontend/package*.json ./ -RUN npm ci +RUN npm install COPY frontend/ ./ RUN npm run build diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..feed822 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,31 @@ +services: + remoteterm: + build: . + ports: + - "8000:8000" + volumes: + - meshcore-data:/app/data + environment: + # Radio connection — set ONE of the following transport options: + + # Serial (USB) — also uncomment the `devices` section below + # MESHCORE_SERIAL_PORT: /dev/ttyUSB0 + # MESHCORE_SERIAL_BAUDRATE: 115200 + + # TCP + # MESHCORE_TCP_HOST: 192.168.1.100 + # MESHCORE_TCP_PORT: 5000 + + # BLE + # MESHCORE_BLE_ADDRESS: AA:BB:CC:DD:EE:FF + # MESHCORE_BLE_PIN: "" + + MESHCORE_LOG_LEVEL: INFO + MESHCORE_DATABASE_PATH: data/meshcore.db + # Uncomment to pass through a USB serial device: + # devices: + # - /dev/ttyUSB0:/dev/ttyUSB0 + restart: unless-stopped + +volumes: + meshcore-data: From d525188cced625170e85cf8fa08dfacba7d9b8ef Mon Sep 17 00:00:00 2001 From: Jack Kingsman Date: Sun, 22 Feb 2026 11:59:58 -0800 Subject: [PATCH 2/4] Change back npm ci and use standard paths + ports --- Dockerfile | 2 +- docker-compose.yaml | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7d8358e..5ab2f49 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM node:20-slim AS frontend-builder WORKDIR /build COPY frontend/package*.json ./ -RUN npm install +RUN npm ci COPY frontend/ ./ RUN npm run build diff --git a/docker-compose.yaml b/docker-compose.yaml index feed822..212ec3e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -4,7 +4,7 @@ services: ports: - "8000:8000" volumes: - - meshcore-data:/app/data + - ./data:/app/data environment: # Radio connection — set ONE of the following transport options: @@ -14,7 +14,7 @@ services: # TCP # MESHCORE_TCP_HOST: 192.168.1.100 - # MESHCORE_TCP_PORT: 5000 + # MESHCORE_TCP_PORT: 4000 # BLE # MESHCORE_BLE_ADDRESS: AA:BB:CC:DD:EE:FF @@ -27,5 +27,3 @@ services: # - /dev/ttyUSB0:/dev/ttyUSB0 restart: unless-stopped -volumes: - meshcore-data: From 7542cc11428853259a84f043a4f655bd1596487e Mon Sep 17 00:00:00 2001 From: Jack Kingsman Date: Sun, 22 Feb 2026 12:07:37 -0800 Subject: [PATCH 3/4] Update README for docker compose --- README.md | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 4d90c4d..bd1cee9 100644 --- a/README.md +++ b/README.md @@ -88,27 +88,28 @@ Access at http://localhost:8000 > **Note:** WebGPU cracking requires HTTPS when not on localhost. See the HTTPS section under Additional Setup. -## Docker +## Docker Compose > **Warning:** Docker has intermittent issues with serial event subscriptions. The native method above is more reliable. > **Note:** BLE-in-docker is outside the scope of this README, but the env vars should all still work. -```bash -# Serial -docker run -d \ - --device=/dev/ttyUSB0 \ - -v remoteterm-data:/app/data \ - -p 8000:8000 \ - jkingsman/remote-terminal-for-meshcore:latest +Edit `docker-compose.yaml` to uncomment your transport (Serial, TCP, or BLE). For serial connections, you'll also need to uncomment the `devices` section to pass through the USB device. Then: -# TCP -docker run -d \ - -e MESHCORE_TCP_HOST=192.168.1.100 \ - -e MESHCORE_TCP_PORT=4000 \ - -v remoteterm-data:/app/data \ - -p 8000:8000 \ - jkingsman/remote-terminal-for-meshcore:latest +```bash +docker compose up -d +``` + +The database is stored in `./data/` (bind-mounted), so the container shares the same database as the native app. To rebuild after pulling updates: + +```bash +docker compose up -d --build +``` + +To stop: + +```bash +docker compose down ``` ## Development @@ -185,21 +186,20 @@ openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -node uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --ssl-keyfile=key.pem --ssl-certfile=cert.pem ``` -For Docker: +For Docker Compose, generate the cert and add the volume mounts and command override to `docker-compose.yaml`: ```bash # generate TLS cert openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj '/CN=localhost' +``` -# run with cert -docker run -d \ - --device=/dev/ttyUSB0 \ - -v remoteterm-data:/app/data \ - -v $(pwd)/cert.pem:/app/cert.pem:ro \ - -v $(pwd)/key.pem:/app/key.pem:ro \ - -p 8000:8000 \ - jkingsman/remote-terminal-for-meshcore:latest \ - uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --ssl-keyfile=/app/key.pem --ssl-certfile=/app/cert.pem +Then add to the `remoteterm` service in `docker-compose.yaml`: + +```yaml + volumes: + - ./cert.pem:/app/cert.pem:ro + - ./key.pem:/app/key.pem:ro + command: uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --ssl-keyfile=/app/key.pem --ssl-certfile=/app/cert.pem ``` Accept the browser warning, or use [mkcert](https://github.com/FiloSottile/mkcert) for locally-trusted certs. From 00aa212049ee856764880dee6c3990bc3dcebfb4 Mon Sep 17 00:00:00 2001 From: Jack Kingsman Date: Sun, 22 Feb 2026 12:42:11 -0800 Subject: [PATCH 4/4] Add notes about ownership glitches + using prebuilt --- Dockerfile | 2 +- README.md | 24 +++++++++++++++++++++++- docker-compose.yaml | 3 ++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5ab2f49..f22f31a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,5 +35,5 @@ RUN mkdir -p /app/data EXPOSE 8000 -# Run the application +# Run the application (we retain root for max compatibility) CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] diff --git a/README.md b/README.md index bd1cee9..042819f 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,27 @@ The database is stored in `./data/` (bind-mounted), so the container shares the docker compose up -d --build ``` +To use the prebuilt Docker Hub image instead of building locally, replace: + +```yaml +build: . +``` + +with: + +```yaml +image: jkingsman/remoteterm-meshcore:latest +``` + +Then run: + +```bash +docker compose pull +docker compose up -d +``` + +The container runs as root by default for maximum serial passthrough compatibility across host setups. On Linux, if you switch between native and Docker runs, `./data` can end up root-owned. If you do not need that compatibility behavior, you can enable the optional `user: "${UID:-1000}:${GID:-1000}"` line in `docker-compose.yaml` to keep ownership aligned with your host user. + To stop: ```bash @@ -193,10 +214,11 @@ For Docker Compose, generate the cert and add the volume mounts and command over openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj '/CN=localhost' ``` -Then add to the `remoteterm` service in `docker-compose.yaml`: +Then add to the `remoteterm` service in `docker-compose.yaml` (keep your existing `./data:/app/data` mount): ```yaml volumes: + - ./data:/app/data - ./cert.pem:/app/cert.pem:ro - ./key.pem:/app/key.pem:ro command: uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --ssl-keyfile=/app/key.pem --ssl-certfile=/app/cert.pem diff --git a/docker-compose.yaml b/docker-compose.yaml index 212ec3e..f0897ac 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,6 +1,8 @@ services: remoteterm: build: . + # Optional on Linux: run container as your host user to avoid root-owned files in ./data + # user: "${UID:-1000}:${GID:-1000}" ports: - "8000:8000" volumes: @@ -26,4 +28,3 @@ services: # devices: # - /dev/ttyUSB0:/dev/ttyUSB0 restart: unless-stopped -