[PHP-FPM] Include Docker api for better SOGo status handling and future changes

master
andryyy 2017-10-04 13:04:15 +02:00
parent 6f91d094e2
commit 9b4ed6b21c
1 changed files with 12 additions and 0 deletions

View File

@ -82,4 +82,16 @@ if [[ ! -z ${DOMAIN_ARRAY} ]]; then
done done
fi fi
# Socket access
DOCKER_SOCKET=/var/run/docker.sock
DOCKER_GROUP=docker
REGULAR_USER=www-data
if [ -S ${DOCKER_SOCKET} ]; then
DOCKER_GID=$(stat -c '%g' ${DOCKER_SOCKET})
delgroup $(stat -c '%G' ${DOCKER_SOCKET})
addgroup -g ${DOCKER_GID} ${DOCKER_GROUP}
adduser ${REGULAR_USER} ${DOCKER_GROUP}
fi
exec "$@" exec "$@"