Skip to content

Commit be5ad57

Browse files
mblaschkeguiyomh
authored andcommitted
✨ Add VIRTUAL_HOST env value to dnsmasq lookup for internal lookup (#119)
* Add VIRTUAL_HOST as dnsmasq lookup * Enable dnsmasq by default for base-app
1 parent 0687212 commit be5ad57

File tree

24 files changed

+84
-24
lines changed

24 files changed

+84
-24
lines changed

docker/base-app/alpine-3/conf/bin/service.d/dnsmasq.d/10-init.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## clear dns file
2-
echo > /etc/dnsmasq.d/development
2+
echo > /etc/dnsmasq.d/webdevops
33

44
if [ ! -f /etc/resolv.conf.original ]; then
55
cp -a /etc/resolv.conf /etc/resolv.conf.original
@@ -10,3 +10,8 @@ if [ ! -f /etc/resolv.conf.original ]; then
1010
## set dnsmasq to main nameserver
1111
echo "nameserver 127.0.0.1" > /etc/resolv.conf
1212
fi
13+
14+
# Add own VIRTUAL_HOST as loopback
15+
if [[ -n "${VIRTUAL_HOST+x}" ]]; then
16+
echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops
17+
fi

docker/base-app/alpine-3/conf/etc/supervisor.d/dnsmasq.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ priority=15
66
command = /opt/docker/bin/service.d/dnsmasq.sh
77
process_name=%(program_name)s
88
startsecs = 0
9-
autostart = false
9+
autostart = true
1010
autorestart = true
1111
stdout_logfile=/dev/stdout
1212
stdout_logfile_maxbytes=0

docker/base-app/centos-7/conf/bin/service.d/dnsmasq.d/10-init.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## clear dns file
2-
echo > /etc/dnsmasq.d/development
2+
echo > /etc/dnsmasq.d/webdevops
33

44
if [ ! -f /etc/resolv.conf.original ]; then
55
cp -a /etc/resolv.conf /etc/resolv.conf.original
@@ -10,3 +10,8 @@ if [ ! -f /etc/resolv.conf.original ]; then
1010
## set dnsmasq to main nameserver
1111
echo "nameserver 127.0.0.1" > /etc/resolv.conf
1212
fi
13+
14+
# Add own VIRTUAL_HOST as loopback
15+
if [[ -n "${VIRTUAL_HOST+x}" ]]; then
16+
echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops
17+
fi

docker/base-app/centos-7/conf/etc/supervisor.d/dnsmasq.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ priority=15
66
command = /opt/docker/bin/service.d/dnsmasq.sh
77
process_name=%(program_name)s
88
startsecs = 0
9-
autostart = false
9+
autostart = true
1010
autorestart = true
1111
stdout_logfile=/dev/stdout
1212
stdout_logfile_maxbytes=0

docker/base-app/debian-7/conf/bin/service.d/dnsmasq.d/10-init.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## clear dns file
2-
echo > /etc/dnsmasq.d/development
2+
echo > /etc/dnsmasq.d/webdevops
33

44
if [ ! -f /etc/resolv.conf.original ]; then
55
cp -a /etc/resolv.conf /etc/resolv.conf.original
@@ -10,3 +10,8 @@ if [ ! -f /etc/resolv.conf.original ]; then
1010
## set dnsmasq to main nameserver
1111
echo "nameserver 127.0.0.1" > /etc/resolv.conf
1212
fi
13+
14+
# Add own VIRTUAL_HOST as loopback
15+
if [[ -n "${VIRTUAL_HOST+x}" ]]; then
16+
echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops
17+
fi

docker/base-app/debian-7/conf/etc/supervisor.d/dnsmasq.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ priority=15
66
command = /opt/docker/bin/service.d/dnsmasq.sh
77
process_name=%(program_name)s
88
startsecs = 0
9-
autostart = false
9+
autostart = true
1010
autorestart = true
1111
stdout_logfile=/dev/stdout
1212
stdout_logfile_maxbytes=0

docker/base-app/debian-8/conf/bin/service.d/dnsmasq.d/10-init.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## clear dns file
2-
echo > /etc/dnsmasq.d/development
2+
echo > /etc/dnsmasq.d/webdevops
33

44
if [ ! -f /etc/resolv.conf.original ]; then
55
cp -a /etc/resolv.conf /etc/resolv.conf.original
@@ -10,3 +10,8 @@ if [ ! -f /etc/resolv.conf.original ]; then
1010
## set dnsmasq to main nameserver
1111
echo "nameserver 127.0.0.1" > /etc/resolv.conf
1212
fi
13+
14+
# Add own VIRTUAL_HOST as loopback
15+
if [[ -n "${VIRTUAL_HOST+x}" ]]; then
16+
echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops
17+
fi

docker/base-app/debian-8/conf/etc/supervisor.d/dnsmasq.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ priority=15
66
command = /opt/docker/bin/service.d/dnsmasq.sh
77
process_name=%(program_name)s
88
startsecs = 0
9-
autostart = false
9+
autostart = true
1010
autorestart = true
1111
stdout_logfile=/dev/stdout
1212
stdout_logfile_maxbytes=0

docker/base-app/debian-9/conf/bin/service.d/dnsmasq.d/10-init.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## clear dns file
2-
echo > /etc/dnsmasq.d/development
2+
echo > /etc/dnsmasq.d/webdevops
33

44
if [ ! -f /etc/resolv.conf.original ]; then
55
cp -a /etc/resolv.conf /etc/resolv.conf.original
@@ -10,3 +10,8 @@ if [ ! -f /etc/resolv.conf.original ]; then
1010
## set dnsmasq to main nameserver
1111
echo "nameserver 127.0.0.1" > /etc/resolv.conf
1212
fi
13+
14+
# Add own VIRTUAL_HOST as loopback
15+
if [[ -n "${VIRTUAL_HOST+x}" ]]; then
16+
echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops
17+
fi

docker/base-app/debian-9/conf/etc/supervisor.d/dnsmasq.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ priority=15
66
command = /opt/docker/bin/service.d/dnsmasq.sh
77
process_name=%(program_name)s
88
startsecs = 0
9-
autostart = false
9+
autostart = true
1010
autorestart = true
1111
stdout_logfile=/dev/stdout
1212
stdout_logfile_maxbytes=0

0 commit comments

Comments
 (0)