dockerhost name support

This commit is contained in:
Jan Prochazka
2022-04-21 18:59:07 +02:00
parent 66da21804b
commit e5bbf5eca3
3 changed files with 28 additions and 2 deletions

11
docker/entrypoint.sh Normal file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
HOST_DOMAIN="dockerhost"
ping -q -c1 $HOST_DOMAIN > /dev/null 2>&1
if [ $? != 0 ]
then
HOST_IP=$(ip route | awk 'NR==1 {print $3}')
echo "$HOST_IP $HOST_DOMAIN" >> /etc/hosts
fi
node bundle.js