mirror of
https://git.myvelabs.com/docker/myvemail.git
synced 2025-12-18 01:36:19 +00:00
First commit
This commit is contained in:
commit
7b58f82156
21 changed files with 1951 additions and 0 deletions
39
build/run/docker-entrypoint/entrypoint.sh
Executable file
39
build/run/docker-entrypoint/entrypoint.sh
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/env bash
|
||||
# Abort if an error is encountered
|
||||
set -e
|
||||
|
||||
# Exit function
|
||||
trap '[ "${?}" -ne 77 ] || exit 77' ERR
|
||||
function die
|
||||
{
|
||||
local reset="\e[0m"
|
||||
local red="\e[0m\e[0;31m"
|
||||
local yellow="\e[0m\e[0;33m"
|
||||
|
||||
echo -e "${red}
|
||||
Error encountered in the following init script:
|
||||
${yellow}
|
||||
${@}
|
||||
${red}
|
||||
Aborting...
|
||||
${reset}"
|
||||
|
||||
exit 77
|
||||
}
|
||||
|
||||
# Reset logs
|
||||
echo | tee /var/log/dovecot.log /var/log/postfix.log /usr/share/webapps/roundcube/logs/errors.log >/dev/null
|
||||
|
||||
# Run all scripts in init folder
|
||||
for file in /docker-entrypoint/init.d/*.sh
|
||||
do
|
||||
bash -c ${file} || die ${file}
|
||||
done
|
||||
|
||||
# Reload services
|
||||
dovecot reload &&
|
||||
postfix reload &&
|
||||
echo -e "\n\e[1;32mMail service is ready\e[0m\n"
|
||||
|
||||
# Monitor log
|
||||
tail -f /var/log/dovecot.log /var/log/postfix.log /usr/share/webapps/roundcube/logs/errors.log
|
||||
Loading…
Add table
Add a link
Reference in a new issue