persistence included

This commit is contained in:
2019-06-13 17:21:40 +02:00
parent 91c2bfe0b1
commit 47a91f2db4
4 changed files with 32 additions and 17 deletions

View File

@ -1,9 +1,11 @@
#!/bin/bash
IMAGE=registry.gitlab.com/wolutator/mosquitto-with-auth:latest
VOLUME=mosquitto-config
VOLUME_CONFIG=mosquitto-config
VOLUME_DATA=mosquitto-data
docker volume inspect $VOLUME > /dev/null || docker volume create $VOLUME
docker volume inspect $VOLUME_CONFIG > /dev/null || docker volume create $VOLUME_CONFIG
docker volume inspect $VOLUME_DATA > /dev/null || docker volume create $VOLUME_DATA
docker pull $IMAGE
@ -13,7 +15,8 @@ docker run \
-p1883:1883 \
-p8883:8883 \
-p9001:9001 \
-v $VOLUME:/opt/etc/mosquitto \
-v $VOLUME_CONFIG:/opt/etc/mosquitto \
-v $VOLUME_DATA:/opt/data \
--link mariadb \
--name mosquitto \
$IMAGE