50 lines
1.2 KiB
Bash
Executable File
50 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
pushd meshtastic-map &>/dev/null
|
|
docker build -t meshtastic-map:latest .
|
|
popd &>/dev/null
|
|
|
|
up () {
|
|
docker run \
|
|
--detach \
|
|
--name meshmap-db \
|
|
--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 \
|
|
--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 \
|
|
--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
|
|
}
|
|
|
|
|
|
$@
|