Allow LadyPoly port check after recently closed connections

This commit is contained in:
Mikei386
2026-09-30 22:33:36 +02:00
parent cf3e354434
commit a603a223c4
+3 -1
View File
@@ -4,7 +4,9 @@ from pathlib import Path
base=Path('/opt/athena-ladypoly/data');name='athena-ladypoly';image='athena-ladypoly:3960afc-deck1' base=Path('/opt/athena-ladypoly/data');name='athena-ladypoly';image='athena-ladypoly:3960afc-deck1'
if subprocess.run(['docker','inspect',name],stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL).returncode==0: if subprocess.run(['docker','inspect',name],stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL).returncode==0:
raise SystemExit('LadyPoly container already exists; no automatic replacement.') raise SystemExit('LadyPoly container already exists; no automatic replacement.')
with socket.socket() as s:s.bind(('127.0.0.1',8127)) with socket.socket() as s:
s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
s.bind(('127.0.0.1',8127))
base.mkdir(parents=True,exist_ok=True);os.chown(base,65534,65534);base.chmod(0o700) base.mkdir(parents=True,exist_ok=True);os.chown(base,65534,65534);base.chmod(0o700)
subprocess.check_call(['docker','run','-d','--name',name,'--network','host','--restart','unless-stopped','--read-only', subprocess.check_call(['docker','run','-d','--name',name,'--network','host','--restart','unless-stopped','--read-only',
'--cap-drop','ALL','--security-opt','no-new-privileges:true','--memory','1g','--cpus','2', '--cap-drop','ALL','--security-opt','no-new-privileges:true','--memory','1g','--cpus','2',