mirror of
https://github.com/zokradonh/kopano-docker.git
synced 2026-08-24 22:55:36 +00:00
make docker-compose easier to use (also by introducing variables and a setup script)
update Dockerfiles/Makefile for use with kopano supported build introduce a local ldap image with some demo users include caddy for reverse proxying add proper documentation and remove obsolete build and push scripts Signed-off-by: Felix Bartels <felix@host-consultants.de>
This commit is contained in:
+57
-27
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
ADDITIONAL_KOPANO_PACKAGES=${ADDITIONAL_KOPANO_PACKAGES:-""}
|
||||
|
||||
set -eu # unset variables are errors & non-zero return values exit the whole script
|
||||
|
||||
if [ ! -e /kopano/$SERVICE_TO_START.py ]
|
||||
@@ -8,6 +10,13 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ ! -z "$ADDITIONAL_KOPANO_PACKAGES" ] && apt update
|
||||
[ ! -z "$ADDITIONAL_KOPANO_PACKAGES" ] && for installpkg in "$ADDITIONAL_KOPANO_PACKAGES"; do
|
||||
if [ $(dpkg-query -W -f='${Status}' $installpkg 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
|
||||
apt --assume-yes install $installpkg;
|
||||
fi
|
||||
done
|
||||
|
||||
mkdir -p /kopano/data/attachments /tmp/$SERVICE_TO_START /var/run/kopano
|
||||
|
||||
echo "Configure core service '$SERVICE_TO_START'" | ts
|
||||
@@ -17,9 +26,6 @@ echo "Set ownership" | ts
|
||||
chown -R kopano:kopano /run /tmp
|
||||
chown kopano:kopano /kopano/data/ /kopano/data/attachments
|
||||
|
||||
echo "Clean old pid files and sockets" | ts
|
||||
rm -f /var/run/kopano/*
|
||||
|
||||
# allow helper commands given by "docker-compose run"
|
||||
if [ $# -gt 0 ]
|
||||
then
|
||||
@@ -29,28 +35,52 @@ fi
|
||||
|
||||
# start regular service
|
||||
case "$SERVICE_TO_START" in
|
||||
server)
|
||||
exec /usr/sbin/kopano-server -F
|
||||
;;
|
||||
dagent)
|
||||
exec /usr/sbin/kopano-dagent -l
|
||||
;;
|
||||
gateway)
|
||||
exec /usr/sbin/kopano-gateway -F
|
||||
;;
|
||||
ical)
|
||||
exec /usr/sbin/kopano-ical -F
|
||||
;;
|
||||
monitor)
|
||||
exec /usr/sbin/kopano-monitor -F
|
||||
;;
|
||||
search)
|
||||
exec /usr/bin/python /usr/sbin/kopano-search -F
|
||||
;;
|
||||
spooler)
|
||||
exec /usr/sbin/kopano-spooler -F
|
||||
;;
|
||||
*)
|
||||
echo "Failed to start: Unknown service name: '$SERVICE_TO_START'" | ts
|
||||
exit 1
|
||||
server)
|
||||
exec dockerize \
|
||||
-wait file://$KCCONF_SERVER_SERVER_SSL_CA_FILE \
|
||||
-wait file://$KCCONF_SERVER_SERVER_SSL_KEY_FILE \
|
||||
-wait tcp://db:3306 \
|
||||
-timeout 360s \
|
||||
/usr/sbin/kopano-server -F
|
||||
;;
|
||||
dagent)
|
||||
exec dockerize \
|
||||
-wait file://var/run/kopano/server.sock \
|
||||
-timeout 360s \
|
||||
/usr/sbin/kopano-dagent -l
|
||||
;;
|
||||
gateway)
|
||||
exec dockerize \
|
||||
-wait tcp://kserver:236 \
|
||||
-timeout 360s \
|
||||
/usr/sbin/kopano-gateway -F
|
||||
;;
|
||||
ical)
|
||||
exec dockerize \
|
||||
-wait tcp://kserver:236 \
|
||||
-timeout 360s \
|
||||
/usr/sbin/kopano-ical -F
|
||||
;;
|
||||
monitor)
|
||||
exec dockerize \
|
||||
-wait file://var/run/kopano/server.sock \
|
||||
-timeout 360s \
|
||||
/usr/sbin/kopano-monitor -F
|
||||
;;
|
||||
search)
|
||||
exec dockerize \
|
||||
-wait file://var/run/kopano/server.sock \
|
||||
-timeout 360s \
|
||||
/usr/bin/python /usr/sbin/kopano-search -F
|
||||
;;
|
||||
spooler)
|
||||
exec dockerize \
|
||||
-wait file://var/run/kopano/server.sock \
|
||||
-wait tcp://mail:25 \
|
||||
-timeout 1080s \
|
||||
/usr/sbin/kopano-spooler -F
|
||||
;;
|
||||
*)
|
||||
echo "Failed to start: Unknown service name: '$SERVICE_TO_START'" | ts
|
||||
exit 1
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user