Skip to content

Commit be3051c

Browse files
committed
NextCloud, wait for dns propagation
1 parent 0316b87 commit be3051c

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

tfgrid3/nextcloud/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
FROM ubuntu:22.04
22

33
RUN apt update && \
4-
apt -y install wget openssh-server curl sudo ufw inotify-tools iproute2
4+
apt -y install wget openssh-server curl sudo ufw inotify-tools iproute2 bind9-dnsutils
55

6-
RUN wget -O /sbin/zinit https://github.com/threefoldtech/zinit/releases/download/v0.2.5/zinit && \
6+
RUN wget -O /sbin/zinit https://github.com/threefoldtech/zinit/releases/download/v0.2.14/zinit && \
77
chmod +x /sbin/zinit
88

99
RUN wget -O /sbin/caddy 'https://caddyserver.com/api/download?os=linux&arch=amd64&p=github.com%2Fcaddyserver%2Freplace-response&idempotency=43631173212363' && \

tfgrid3/nextcloud/scripts/caddy.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ export DOMAIN=$NEXTCLOUD_DOMAIN
33

44
if $IPV4 && ! $GATEWAY; then
55
export PORT=443
6+
7+
# Wait for DNS to propagate
8+
interface=$(ip route show default | cut -d " " -f 5)
9+
ipv4_address=$(ip a show $interface | grep -Po 'inet \K[\d.]+')
10+
while ! dig $DOMAIN | grep -q $ipv4_address; do
11+
sleep 5
12+
done
613
else
714
export PORT=80
815
fi
@@ -17,4 +24,4 @@ else
1724
`needs ports 3478/TCP and 3478/UDP open/forwarded in your firewall/router` `running the Talk container requires a public IP and this VM does not have one. It is still possible to use Talk in a limited capacity. Please consult the documentation for details`'
1825
fi
1926

20-
caddy run --config /etc/caddy/Caddyfile
27+
caddy run --config /etc/caddy/Caddyfile

0 commit comments

Comments
 (0)