-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Issue 631 run services with supervisor #676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tomav
merged 12 commits into
docker-mailserver:master
from
johansmitsnl:issue-631-run-services-with-supervisor
Aug 7, 2017
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1858f8c
installed supervisor. Still need to set tasks to run in foreground.
LukeAllen 663c180
setting programs to run in foreground
LukeAllen c7824e8
seems to work now
LukeAllen a16b753
cleanup
LukeAllen 36a8548
final fixes
LukeAllen d1e695d
tests
LukeAllen fb825a0
show startup output on stdout
LukeAllen 1fad287
set Dovecot config files before starting it
LukeAllen ea6a81e
make all processes log to console
LukeAllen c3da995
Use the supervisor as the main process. The start-mailserver is started
johansmitsnl 7370b90
Remove obsolete comments, reset timeout value to old one, added new l…
johansmitsnl 2ced667
Add more time for analyzing the emails.
johansmitsnl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ run: | |
| -v "`pwd`/test":/tmp/docker-mailserver-test \ | ||
| -v "`pwd`/test/config/letsencrypt":/etc/letsencrypt/live \ | ||
| -e ENABLE_POP3=1 \ | ||
| -e DMS_DEBUG=1 \ | ||
| -e DMS_DEBUG=0 \ | ||
| -e SSL_TYPE=letsencrypt \ | ||
| -h mail.my-domain.com -t $(NAME) | ||
| sleep 15 | ||
|
|
@@ -49,6 +49,7 @@ run: | |
| -v "`pwd`/test":/tmp/docker-mailserver-test \ | ||
| -e SMTP_ONLY=1 \ | ||
| -e PERMIT_DOCKER=network \ | ||
| -e DMS_DEBUG=0 \ | ||
| -e OVERRIDE_HOSTNAME=mail.my-domain.com \ | ||
| -t $(NAME) | ||
| sleep 15 | ||
|
|
@@ -63,6 +64,7 @@ run: | |
| -v "`pwd`/test/config":/tmp/docker-mailserver \ | ||
| -v "`pwd`/test":/tmp/docker-mailserver-test \ | ||
| -e PERMIT_DOCKER=network \ | ||
| -e DMS_DEBUG=0 \ | ||
| -e OVERRIDE_HOSTNAME=mail.my-domain.com \ | ||
| -h mail.my-domain.com \ | ||
| -t $(NAME) | ||
|
|
@@ -79,13 +81,15 @@ run: | |
| -v "`pwd`/test":/tmp/docker-mailserver-test \ | ||
| -e ENABLE_FETCHMAIL=1 \ | ||
| --cap-add=NET_ADMIN \ | ||
| -e DMS_DEBUG=0 \ | ||
| -h mail.my-domain.com -t $(NAME) | ||
| sleep 15 | ||
| docker run -d --name mail_disabled_clamav_spamassassin \ | ||
| -v "`pwd`/test/config":/tmp/docker-mailserver \ | ||
| -v "`pwd`/test":/tmp/docker-mailserver-test \ | ||
| -e ENABLE_CLAMAV=0 \ | ||
| -e ENABLE_SPAMASSASSIN=0 \ | ||
| -e DMS_DEBUG=0 \ | ||
| -h mail.my-domain.com -t $(NAME) | ||
| sleep 15 | ||
| docker run -d --name mail_manual_ssl \ | ||
|
|
@@ -94,6 +98,7 @@ run: | |
| -e SSL_TYPE=manual \ | ||
| -e SSL_CERT_PATH=/tmp/docker-mailserver/letsencrypt/mail.my-domain.com/fullchain.pem \ | ||
| -e SSL_KEY_PATH=/tmp/docker-mailserver/letsencrypt/mail.my-domain.com/privkey.pem \ | ||
| -e DMS_DEBUG=0 \ | ||
| -h mail.my-domain.com -t $(NAME) | ||
| sleep 15 | ||
| docker run -d --name ldap_for_mail \ | ||
|
|
@@ -120,6 +125,7 @@ run: | |
| -e SASLAUTHD_LDAP_PASSWORD=admin \ | ||
| -e SASLAUTHD_LDAP_SEARCH_BASE=ou=people,dc=localhost,dc=localdomain \ | ||
| -e [email protected] \ | ||
| -e DMS_DEBUG=0 \ | ||
| --link ldap_for_mail:ldap \ | ||
| -h mail.my-domain.com -t $(NAME) | ||
| sleep 15 | ||
|
|
@@ -130,15 +136,16 @@ run: | |
| -e SASLAUTHD_MECHANISMS=rimap \ | ||
| -e SASLAUTHD_MECH_OPTIONS=127.0.0.1 \ | ||
| -e [email protected] \ | ||
| -e DMS_DEBUG=0 \ | ||
| -h mail.my-domain.com -t $(NAME) | ||
| # Wait for containers to fully start | ||
| sleep 15 | ||
| docker run -d --name mail_lmtp_ip \ | ||
| -v "`pwd`/test/config":/tmp/docker-mailserver \ | ||
| -v "`pwd`/test/config/dovecot-lmtp":/etc/dovecot \ | ||
| -v "`pwd`/test":/tmp/docker-mailserver-test \ | ||
| -e ENABLE_POSTFIX_VIRTUAL_TRANSPORT=1 \ | ||
| -e POSTFIX_DAGENT=lmtp:127.0.0.1:24 \ | ||
| -e DMS_DEBUG=0 \ | ||
| -h mail.my-domain.com -t $(NAME) | ||
| sleep 30 | ||
| docker run -d --name mail_with_postgrey \ | ||
|
|
@@ -148,6 +155,7 @@ run: | |
| -e POSTGREY_DELAY=15 \ | ||
| -e POSTGREY_MAX_AGE=35 \ | ||
| -e POSTGREY_TEXT="Delayed by postgrey" \ | ||
| -e DMS_DEBUG=0 \ | ||
| -h mail.my-domain.com -t $(NAME) | ||
| sleep 20 | ||
|
|
||
|
|
@@ -179,7 +187,7 @@ fixtures: | |
|
|
||
| docker exec mail_override_hostname /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/existing-user1.txt" | ||
| # Wait for mails to be analyzed | ||
| sleep 20 | ||
| sleep 40 | ||
|
|
||
| tests: | ||
| # Start tests | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| #!/usr/bin/env bash | ||
| # fail2ban-wrapper.sh, version 0.0.1 | ||
| # | ||
| # You cannot start fail2ban in some foreground mode and | ||
| # it's more or less important that docker doesn't kill | ||
| # fail2ban and its chilren if you stop the container. | ||
| # | ||
| # Use this script with supervisord and it will take | ||
| # care about starting and stopping fail2ban correctly. | ||
| # | ||
| # supervisord config snippet for fail2ban-wrapper: | ||
| # | ||
| # [program:fail2ban] | ||
| # process_name = fail2ban | ||
| # command = /path/to/fail2ban-wrapper.sh | ||
| # startsecs = 0 | ||
| # autorestart = false | ||
| # | ||
|
|
||
| trap "/usr/bin/fail2ban-client stop" SIGINT | ||
| trap "/usr/bin/fail2ban-client stop" SIGTERM | ||
| trap "/usr/bin/fail2ban-client reload" SIGHUP | ||
|
|
||
| # start fail2ban | ||
| /usr/bin/fail2ban-client start | ||
|
|
||
| # lets give fail2ban some time to start | ||
| sleep 5 | ||
|
|
||
| # wait until fail2ban is dead (triggered by trap) | ||
| while kill -0 "`cat /var/run/fail2ban/fail2ban.pid`"; do | ||
| sleep 5 | ||
| done | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| #!/usr/bin/env bash | ||
| # postfix-wrapper.sh, version 0.1.0 | ||
| # | ||
| # You cannot start postfix in some foreground mode and | ||
| # it's more or less important that docker doesn't kill | ||
| # postfix and its chilren if you stop the container. | ||
| # | ||
| # Use this script with supervisord and it will take | ||
| # care about starting and stopping postfix correctly. | ||
| # | ||
| # supervisord config snippet for postfix-wrapper: | ||
| # | ||
| # [program:postfix] | ||
| # process_name = postfix | ||
| # command = /path/to/postfix-wrapper.sh | ||
| # startsecs = 0 | ||
| # autorestart = false | ||
| # | ||
|
|
||
| trap "service postfix stop" SIGINT | ||
| trap "service postfix stop" SIGTERM | ||
| trap "service postfix reload" SIGHUP | ||
|
|
||
| # start postfix | ||
| service postfix start | ||
|
|
||
| # lets give postfix some time to start | ||
| sleep 5 | ||
|
|
||
| # wait until postfix is dead (triggered by trap) | ||
| while kill -0 "`cat /var/spool/postfix/pid/master.pid`"; do | ||
| sleep 5 | ||
| done | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If sleep increased too 40 at the end, perhaps this one can be set to 15 like previous.