diff --git a/README.md b/README.md index 9912c91..875922a 100644 --- a/README.md +++ b/README.md @@ -13,17 +13,32 @@ Usage example === ###Needed directories on host: - data +- mysql + +### with sameersbn/mysql as database + +``` +NAME="observium" +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +docker run -d -m 1g \ + -v $DIR/mysql:/var/lib/mysql \ + -e DB_USER=$NAME \ + -e DB_PASS=observiumpwd \ + -e DB_NAME=$NAME \ + --name $NAME-db \ + sameersbn/mysql:latest +``` ``` +NAME="observium" +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) docker run -d \ - -v /hostDir/config:/config \ - -v /hostDir/logs:/opt/observium/logs \ - -v /hostDir/rrd:/opt/observium/rrd \ + -v $DIR/data:/data \ -p 80:80 \ -e TZ="Europe/Austria" \ - --link observium-db:mysql \ + --link $NAME-db:mysql \ -e POLLER=24 \ - --name observium \ + --name $NAME \ seti/observium ``` diff --git a/init.sh b/init.sh index 05d9a67..c8284fe 100644 --- a/init.sh +++ b/init.sh @@ -4,12 +4,15 @@ atd if [ ! -f /data/config ]; then mkdir /data/config + chown nobody:users /data/config fi if [ ! -f /data/rrd ]; then mkdir /data/rrd + chown nobody:users /data/rrd fi if [ ! -f /data/logs ]; then mkdir /data/logs + chown nobody:users /data/logs fi # Check if PHP database config exists. If not, copy in the default config