mirror of
https://github.com/ggogel/seafile-containerized.git
synced 2024-11-16 09:01:38 +00:00
Make sure nginx is ready when bootstrapping with letsencrypt.
This commit is contained in:
parent
5061545995
commit
71390ad11f
2
launcher
2
launcher
|
@ -134,7 +134,7 @@ bootstrap() {
|
||||||
docker history $image >/dev/null 2>&1 || {
|
docker history $image >/dev/null 2>&1 || {
|
||||||
show_progress "Pulling Seafile server image $version, this may take a while."
|
show_progress "Pulling Seafile server image $version, this may take a while."
|
||||||
docker pull $image
|
docker pull $image
|
||||||
show_progress "Seafile server image $version pulled"
|
show_progress "Seafile server image $version pulled. Now bootstrapping the server ..."
|
||||||
}
|
}
|
||||||
|
|
||||||
# First initialize seafile server and letsencrypt
|
# First initialize seafile server and letsencrypt
|
||||||
|
|
|
@ -41,7 +41,12 @@ def init_letsencrypt():
|
||||||
# Create a temporary nginx conf to start a server, which would accessed by letsencrypt
|
# Create a temporary nginx conf to start a server, which would accessed by letsencrypt
|
||||||
render_template('/templates/seafile.nginx.conf.template',
|
render_template('/templates/seafile.nginx.conf.template',
|
||||||
'/etc/nginx/sites-enabled/seafile.nginx.conf', context)
|
'/etc/nginx/sites-enabled/seafile.nginx.conf', context)
|
||||||
|
|
||||||
|
# TODO: The 5 seconds heuristic is not good, how can we know for sure nginx is ready?
|
||||||
|
print 'waiting for mysql server to be ready'
|
||||||
|
time.sleep(5)
|
||||||
call('nginx -s reload')
|
call('nginx -s reload')
|
||||||
|
|
||||||
call('/scripts/ssl.sh {0} {1}'.format(ssl_dir, domain))
|
call('/scripts/ssl.sh {0} {1}'.format(ssl_dir, domain))
|
||||||
# if call('/scripts/ssl.sh {0} {1}'.format(ssl_dir, domain), check_call=False) != 0:
|
# if call('/scripts/ssl.sh {0} {1}'.format(ssl_dir, domain), check_call=False) != 0:
|
||||||
# eprint('Now waiting 1000s for postmortem')
|
# eprint('Now waiting 1000s for postmortem')
|
||||||
|
|
|
@ -40,7 +40,8 @@ def main():
|
||||||
json.dump(admin_pw, fp)
|
json.dump(admin_pw, fp)
|
||||||
|
|
||||||
while not exists('/var/run/mysqld/mysqld.sock'):
|
while not exists('/var/run/mysqld/mysqld.sock'):
|
||||||
time.sleep(1)
|
print 'waiting for mysql server to be ready'
|
||||||
|
time.sleep(2)
|
||||||
print 'mysql server is ready'
|
print 'mysql server is ready'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue