diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0e8f1d9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3.10-slim +ENV PYTHONUNBUFFERED=1 + +RUN apt-get update && apt-get install -y gettext && rm -rf /var/lib/apt/lists/* + + +WORKDIR /app +COPY . /app +COPY requirements.txt . + +RUN pip install -r requirements.txt +COPY . . + +COPY config.ini /app/config.ini +COPY entrypoint.sh /app/entrypoint.sh + +RUN chmod +x /app/entrypoint.sh +ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/README.md b/README.md index 7167176..9221e16 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,11 @@ Optionally: - `install.sh` will automate optional venv and requirements installation. - `launch.sh` will activate and launch the app in the venv if built. +For Docker: +- `git clone https://github.com/spudgunman/meshing-around` +- `cd meshing-around && docker build -t meshing-around` +- `docker run meshing-around` + ### Configurations Copy the [config.template](config.template) to `config.ini` and set the appropriate interface for your method (serial/ble/tcp). While BLE and TCP will work, they are not as reliable as serial connections. There is a watchdog to reconnect tcp if possible. To get BLE mac `meshtastic --ble-scan` **NOTE** I have only tested with a single BLE device and the code is written to only have one interface be a BLE port diff --git a/config.template b/config.template index 652fb6c..1d4c769 100644 --- a/config.template +++ b/config.template @@ -106,4 +106,4 @@ signalDetectionThreshold = -10 signalHoldTime = 10 # the following are combined to reset the monitor signalCooldown = 5 -signalCycleLimit = 5 +signalCycleLimit = 5 \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..86701b7 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# Substitute environment variables in the config file +envsubst < /app/config.ini > /app/config.tmp && mv /app/config.tmp /app/config.ini + +exec python /app/mesh_bot.py \ No newline at end of file