mirror of
https://github.com/dbgate/dbgate
synced 2024-09-20 05:13:05 +00:00
dockerhost name support
This commit is contained in:
parent
66da21804b
commit
e5bbf5eca3
@ -1,10 +1,18 @@
|
||||
FROM node:14
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
iputils-ping \
|
||||
iproute2 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /home/dbgate-docker
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN ["chmod", "+x", "/home/dbgate-docker/entrypoint.sh"]
|
||||
|
||||
WORKDIR /home/dbgate-docker
|
||||
EXPOSE 3000
|
||||
VOLUME /root/dbgate-data
|
||||
CMD node bundle.js
|
||||
|
||||
CMD ["/home/dbgate-docker/entrypoint.sh"]
|
||||
|
@ -2,9 +2,16 @@ FROM node:14-alpine
|
||||
|
||||
WORKDIR /home/dbgate-docker
|
||||
|
||||
RUN apk --no-cache upgrade \
|
||||
&& apk --no-cache add \
|
||||
iputils
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN ["chmod", "+x", "/home/dbgate-docker/entrypoint.sh"]
|
||||
|
||||
WORKDIR /home/dbgate-docker
|
||||
EXPOSE 3000
|
||||
VOLUME /root/dbgate-data
|
||||
CMD node bundle.js
|
||||
|
||||
CMD ["/home/dbgate-docker/entrypoint.sh"]
|
||||
|
11
docker/entrypoint.sh
Normal file
11
docker/entrypoint.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user