mirror of
https://bitbucket.org/shim_/mumble.git
synced 2019-09-08 21:58:51 +02:00
wait for mysql to come up
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk update && \
|
||||
apk add --no-cache murmur qt-mysql wget bash
|
||||
apk add --no-cache murmur qt-mysql netcat-openbsd wget bash
|
||||
RUN wget --no-check-certificate -O /usr/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.0.1/dumb-init_1.0.1_amd64
|
||||
|
||||
COPY murmur.conf /etc/murmur.conf
|
||||
|
16
init.sh
16
init.sh
@@ -13,6 +13,14 @@ function write_config_if_else {
|
||||
fi
|
||||
}
|
||||
|
||||
function wait_for_mysql {
|
||||
if [ ! -z "$DATABASE" ] && [ "$DATABASE" == "MYSQL" ]; then
|
||||
PORT=3306
|
||||
if [ ! -z "$DB_PORT" ] ; then PORT="$DB_PORT" ;fi
|
||||
while ! nc -z $DB_HOST $PORT; do sleep 3; done
|
||||
fi
|
||||
}
|
||||
|
||||
if [ ! -e /data/murmur.conf ]; then
|
||||
echo Starting Initialization
|
||||
cp /etc/murmur.conf /data/murmur.conf
|
||||
@@ -37,9 +45,11 @@ if [ ! -e /data/murmur.conf ]; then
|
||||
else
|
||||
write_config 'database' '/data/db.sqlite'
|
||||
fi
|
||||
|
||||
if [ ! -z "$SUPW" ] ; then /usr/bin/murmurd -fg -ini /data/murmur.conf -supw $SUPW ;fi
|
||||
echo Initilization Completed
|
||||
fi
|
||||
|
||||
wait_for_mysql
|
||||
if [ ! -z "$SUPW" ] ; then /usr/bin/murmurd -fg -ini /data/murmur.conf -supw $SUPW ;fi
|
||||
|
||||
fi
|
||||
wait_for_mysql
|
||||
/usr/bin/murmurd -fg -ini /data/murmur.conf
|
||||
|
Reference in New Issue
Block a user