2024-11-23 12:26:34 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
up () {
|
2024-11-24 10:52:03 -05:00
|
|
|
pushd meshtastic-map &>/dev/null
|
|
|
|
docker build -t meshtastic-map:latest .
|
|
|
|
popd &>/dev/null
|
|
|
|
|
2024-11-23 12:26:34 -05:00
|
|
|
docker run \
|
|
|
|
--detach \
|
|
|
|
--name meshmap-db \
|
2024-12-16 20:33:10 -05:00
|
|
|
--restart unless-stopped \
|
2024-11-23 12:26:34 -05:00
|
|
|
--env MARIADB_DATABASE=meshtastic-map_db \
|
|
|
|
--env MARIADB_ROOT_PASSWORD=meshtastic-map_pw \
|
|
|
|
--volume /mammoth/meshmap/db/mariadb:/bitnami/mariadb:rw \
|
|
|
|
--network pew-net \
|
|
|
|
bitnami/mariadb
|
|
|
|
|
|
|
|
echo 'Waiting 10 seconds for mariadb to start up...'
|
|
|
|
sleep 10
|
|
|
|
|
|
|
|
docker run \
|
|
|
|
--detach \
|
|
|
|
--name meshmap-mqtt \
|
|
|
|
--env-file $HOME/scripts-private/lech/meshmap.env \
|
2024-12-16 20:33:10 -05:00
|
|
|
--restart unless-stopped \
|
|
|
|
--label com.centurylinklabs.watchtower.enable=false \
|
2024-11-23 12:26:34 -05:00
|
|
|
--env DATABASE_URL="mysql://root:meshtastic-map_pw@meshmap-db:3306/meshtastic-map_db?connection_limit=100" \
|
|
|
|
--network pew-net \
|
|
|
|
meshtastic-map:latest /app/docker/mqtt.sh
|
|
|
|
|
|
|
|
# 8080 on pew-net
|
|
|
|
docker run \
|
|
|
|
--detach \
|
|
|
|
--name meshmap-map \
|
2024-12-16 20:33:10 -05:00
|
|
|
--restart unless-stopped \
|
|
|
|
--label com.centurylinklabs.watchtower.enable=false \
|
2024-11-23 12:26:34 -05:00
|
|
|
--env DATABASE_URL="mysql://root:meshtastic-map_pw@meshmap-db:3306/meshtastic-map_db?connection_limit=100" \
|
|
|
|
--network pew-net \
|
|
|
|
meshtastic-map:latest /app/docker/map.sh
|
|
|
|
}
|
|
|
|
|
|
|
|
down () {
|
|
|
|
docker stop meshmap-db || true
|
|
|
|
docker rm meshmap-db || true
|
|
|
|
docker stop meshmap-mqtt || true
|
|
|
|
docker rm meshmap-mqtt || true
|
|
|
|
docker stop meshmap-map || true
|
|
|
|
docker rm meshmap-map || true
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$@
|