mirror of
https://github.com/DerTyp7/docker_minecraft_server_auto_starter.git
synced 2025-10-29 12:42:09 +01:00
Add placeholder server sleeping IP environment
variable
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user