initial version

This commit is contained in:
2026-10-29 21:13:01 +01:00
parent a076b082b8
commit 5532211785
10 changed files with 613 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/bin/sh
# Container entrypoint.
#
# The backend talks to game servers through the address that is advertised to
# browsers (servers.<key>.address, e.g. localhost:7192). Inside the backend
# container "localhost" is the container itself, not the game container, so
# with AL_GAME_RELAY=1 a small TCP forwarder publishes the game port on
# 127.0.0.1 for the backend only.
set -eu
if [ "${AL_GAME_RELAY:-0}" = "1" ]; then
GAME_HOST="${AL_GAME_HOST:-al-game}"
GAME_PORT="${AL_GAME_PORT:-7192}"
echo "Relaying 127.0.0.1:${GAME_PORT} -> ${GAME_HOST}:${GAME_PORT}"
socat "TCP-LISTEN:${GAME_PORT},fork,reuseaddr,bind=127.0.0.1" "TCP:${GAME_HOST}:${GAME_PORT}" &
fi
exec "$@"