Add placeholder server sleeping IP environment

variable
This commit is contained in:
Janis
2023-11-24 20:47:09 +01:00
parent b6ad4608cb
commit bb2e48bc30
8 changed files with 131 additions and 83 deletions

View File

@@ -1,4 +1,5 @@
import os
import time
class NginxHandler:
@@ -24,7 +25,8 @@ class NginxHandler:
print(f.read())
def setup_config_file(self, port_ip_map, current_container_ip):
proxy_timeout = "300ms"
placeholder_ip = os.environ.get('PLACEHOLDER_SERVER_SLEEPING_IP')
proxy_timeout = "5s"
self.stop()
print('Setting up NGINX config file...')
print('port_ip_map: {}'.format(port_ip_map))
@@ -39,6 +41,10 @@ class NginxHandler:
port_ip_map[port]))
nginx_conf.write(
' server 127.0.0.1:{} backup;\n'.format(port))
nginx_conf.write(
' server {}:25565 backup;\n'.format(placeholder_ip))
nginx_conf.write(' }\n')
nginx_conf.write(' server {\n')