From 9f6a2acc946179b22fbd57e40acd989160233cfd Mon Sep 17 00:00:00 2001 From: Janis Date: Fri, 24 Nov 2023 23:19:36 +0100 Subject: [PATCH] Fix placeholder server IP handling --- app/requestHandler.py | 3 +++ docker-compose.yml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/requestHandler.py b/app/requestHandler.py index 5a2f2f2..33e862e 100644 --- a/app/requestHandler.py +++ b/app/requestHandler.py @@ -68,6 +68,9 @@ class RequestHandler(threading.Thread): print('Container is starting. Using starting placeholder IP') ip = os.environ.get('PLACEHOLDER_SERVER_STARTING_IP') + if not ip: + print('No placeholder server IP found') + return server_socket.connect( (ip, 25565)) server_socket.sendall(request) diff --git a/docker-compose.yml b/docker-compose.yml index fe555c5..9add449 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: "3.9" networks: - # You need to have a network with static ips for the servers. + # You need to have a network with static ips for the servers mc_network: driver: bridge ipam: @@ -25,7 +25,7 @@ services: # Port mapping for the servers # The key is the external port of the placeholder server # The value is the internal ip of the actual server - # Don't change the server port in the actual server. Use this instead. + # Don't change the server port in the actual server. Use this instead PORT_IP_MAP: | 25565: 172.20.0.5 25566: 172.20.0.6