mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-22 07:30:24 +00:00
use internal container ip
This commit is contained in:
parent
b74025f437
commit
ed821b94ff
3 changed files with 3 additions and 4 deletions
|
@ -11,7 +11,7 @@ COPY static ./static
|
|||
COPY requirements.txt main.py hostname.py database.sqlite ./
|
||||
RUN apt update
|
||||
|
||||
# Install supervisords
|
||||
# Install supervisord
|
||||
RUN apt install -y supervisor iproute2
|
||||
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY config/cmd.sh /cmd.sh
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
# start by supervisord
|
||||
internal_ip=$(ip addr show eth0 | awk '/inet /{split($2, a, "/"); print a[1]}')
|
||||
python3 /usr/src/app/hostname.py
|
||||
nsenter -m -u -i -n -p -t 1 sh -c "sed -i '/websoft9-appmanage/d' /etc/hosts"
|
||||
nsenter -m -u -i -n -p -t 1 sh -c "echo $internal_ip websoft9-appmanage>> /etc/hosts"
|
||||
/usr/bin/supervisord
|
||||
supervisorctl start all
|
||||
tail -f /dev/null
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
from api.utils.common_log import myLogger
|
||||
from api.utils import shell_execute
|
||||
|
||||
shell_execute.execute_command_output_all("echo 11111 >> /tmp/test")
|
||||
shell_execute.execute_command_output_all("docker inspect websoft9-appmanage >> /tmp/test")
|
||||
shell_execute.execute_command_output_all("sed -i '/websoft9-appmanage/d' /etc/hosts")
|
||||
shell_execute.execute_command_output_all("echo $(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' websoft9-appmanage) websoft9-appmanage >> /etc/hosts")
|
Loading…
Reference in a new issue