mirror of
https://github.com/DerTyp7/docker_minecraft_server_auto_starter.git
synced 2025-10-29 12:42:09 +01:00
Refactor Dockerfile and nginxHandler.py
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
mc_placeholder_starting:
|
||||
container_name: mc_placeholder_starting
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- "20000:20000"
|
||||
environment:
|
||||
type: "PAPER"
|
||||
EULA: "TRUE"
|
||||
MOTD: "starting..."
|
||||
MAX_PLAYERS: "0"
|
||||
MAX_MEMORY: "200M"
|
||||
SERVER_PORT: "20000"
|
||||
ONLINE_MODE: "FALSE"
|
||||
@@ -24,6 +24,7 @@ class NginxHandler:
|
||||
print(f.read())
|
||||
|
||||
def setup_config_file(self, port_ip_map, current_container_ip):
|
||||
proxy_timeout = "300ms"
|
||||
self.stop()
|
||||
print('Setting up NGINX config file...')
|
||||
print('port_ip_map: {}'.format(port_ip_map))
|
||||
@@ -43,6 +44,12 @@ class NginxHandler:
|
||||
nginx_conf.write(' server {\n')
|
||||
nginx_conf.write(' listen {}:{};\n'.format(
|
||||
current_container_ip, port))
|
||||
|
||||
nginx_conf.write(' proxy_connect_timeout {};\n'.format(
|
||||
proxy_timeout))
|
||||
nginx_conf.write(' proxy_timeout {};\n'.format(
|
||||
proxy_timeout))
|
||||
|
||||
nginx_conf.write(' proxy_pass upstream_{};\n'.format(port))
|
||||
nginx_conf.write(' }\n')
|
||||
nginx_conf.write('}\n')
|
||||
|
||||
Reference in New Issue
Block a user