Skip to content

Commit

Permalink
Merge pull request #5730 from JMarcosHP/main
Browse files Browse the repository at this point in the history
Add apache container reachability check and retry mechanism to run-exec-commands.sh
  • Loading branch information
szaimen authored Dec 20, 2024
2 parents 05bad1b + 3c2a1ed commit 4379446
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Containers/nextcloud/run-exec-commands.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/bash

# Wait 15s for domain to be reachable
sleep 15
# Wait until the apache container is ready
while ! nc -z "$APACHE_HOST" "$APACHE_PORT"; do
echo "Waiting for Apache to become available..."
sleep 15
done

if [ -n "$NEXTCLOUD_EXEC_COMMANDS" ]; then
echo "#!/bin/bash" > /tmp/nextcloud-exec-commands
Expand Down
3 changes: 2 additions & 1 deletion manual-install/latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ services:
- POSTGRES_USER=nextcloud
- REDIS_HOST=nextcloud-aio-redis
- REDIS_HOST_PASSWORD=${REDIS_PASSWORD}
- APACHE_HOST=nextcloud-aio-apache
- APACHE_PORT
- NC_DOMAIN
- ADMIN_USER=admin
- ADMIN_PASSWORD=${NEXTCLOUD_PASSWORD}
Expand Down Expand Up @@ -174,7 +176,6 @@ services:
- TALK_RECORDING_HOST=nextcloud-aio-talk-recording
- FULLTEXTSEARCH_PASSWORD
- REMOVE_DISABLED_APPS
- APACHE_PORT
- IMAGINARY_SECRET
- WHITEBOARD_SECRET
- WHITEBOARD_ENABLED
Expand Down
3 changes: 2 additions & 1 deletion php/containers.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@
"POSTGRES_USER=nextcloud",
"REDIS_HOST=nextcloud-aio-redis",
"REDIS_HOST_PASSWORD=%REDIS_PASSWORD%",
"APACHE_HOST=nextcloud-aio-apache",
"APACHE_PORT=%APACHE_PORT%",
"AIO_TOKEN=%AIO_TOKEN%",
"NC_DOMAIN=%NC_DOMAIN%",
"ADMIN_USER=admin",
Expand Down Expand Up @@ -251,7 +253,6 @@
"FULLTEXTSEARCH_PASSWORD=%FULLTEXTSEARCH_PASSWORD%",
"DOCKER_SOCKET_PROXY_ENABLED=%DOCKER_SOCKET_PROXY_ENABLED%",
"REMOVE_DISABLED_APPS=%REMOVE_DISABLED_APPS%",
"APACHE_PORT=%APACHE_PORT%",
"ADDITIONAL_TRUSTED_PROXY=%CADDY_IP_ADDRESS%",
"THIS_IS_AIO=true",
"IMAGINARY_SECRET=%IMAGINARY_SECRET%",
Expand Down

0 comments on commit 4379446

Please sign in to comment.