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:
13
app/utils.py
Normal file
13
app/utils.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import os
|
||||
|
||||
|
||||
def docker_container_mapping():
|
||||
port_ip_map_str = os.environ.get('PORT_IP_MAP')
|
||||
# Convert the environment variable to a Python dictionary
|
||||
port_ip_map = {}
|
||||
for line in port_ip_map_str.split('\n'):
|
||||
if line: # ignore empty lines
|
||||
port, ip = line.split(':')
|
||||
port_ip_map[port.strip()] = ip.strip()
|
||||
|
||||
return port_ip_map
|
||||
Reference in New Issue
Block a user