Skip to content

Commit

Permalink
Added env variable to nextcloud container, changed reachability in fa…
Browse files Browse the repository at this point in the history
…vor of apache container host.

Signed-off-by: JMarcosHP <jehuherrerap@hotmail.com>
  • Loading branch information
JMarcosHP committed Dec 17, 2024
1 parent 79d4ce1 commit 3c2a1ed
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
22 changes: 4 additions & 18 deletions Containers/nextcloud/run-exec-commands.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
#!/bin/bash

# ENV Variables
MAX_RETRY=3
COUNT=1

# Wait until the domain is reachable
sleep 15
while [ "$COUNT" -le "$MAX_RETRY" ]; do
if nc -z "$NC_DOMAIN" 443; then
echo "Domain reached."
break
else
echo "Attempt $COUNT: Domain not reachable. Retrying in 15 seconds..."
sleep 15
((COUNT++))
fi
# 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 [ "$COUNT" -gt "$MAX_RETRY" ]; then
echo "The domain could not be reached after $MAX_RETRY attempts. Proceeding anyway..."
fi

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 3c2a1ed

Please sign in to comment.