Skip to content
This repository was archived by the owner on Sep 22, 2024. It is now read-only.

Commit ca55004

Browse files
author
Christoph Bühler
committed
fix: correctly set dns variable in nginx conf
1 parent e4fd8b0 commit ca55004

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

gui/15-set-dns-server.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

gui/25-set-dns-server.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
if [ -z "$DNS_SERVER" ] && [ -f "/etc/resolv.conf" ]; then
4+
echo "DNS SERVERS variable not set and resolv conf file found"
5+
export DNS_SERVER=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf)
6+
echo "DNS SERVERS: $DNS_SERVER"
7+
fi
8+
9+
if [ -z "$DNS_SERVER" ] && [ ! -f "/etc/resolv.conf" ]; then
10+
echo "DNS SERVERS variable not set and resolv conf file not found. Default to 8.8.8.8."
11+
export DNS_SERVER=8.8.8.8
12+
echo "DNS SERVERS: $DNS_SERVER"
13+
fi
14+
15+
/docker-entrypoint.d/20-envsubst-on-templates.sh

gui/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ ENV PORT=80
2626

2727
COPY --from=build /app/gui/dist/* /usr/share/nginx/html/
2828
COPY ./gui/nginx.conf /etc/nginx/templates/default.conf.template
29-
COPY ./gui/15-set-dns-server.sh /docker-entrypoint.d/15-set-dns-server.sh
30-
RUN chmod +x /docker-entrypoint.d/15-set-dns-server.sh
29+
COPY ./gui/25-set-dns-server.sh /docker-entrypoint.d/25-set-dns-server.sh
30+
RUN chmod +x /docker-entrypoint.d/25-set-dns-server.sh

0 commit comments

Comments
 (0)