L2J Mobius High Five docker setup

This commit is contained in:
2026-09-11 11:54:14 +00:00
commit c2e35cf5ee
27741 changed files with 2714798 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
ARG BUILD_IMAGE=l2j-build:latest
FROM ${BUILD_IMAGE} AS builder
FROM eclipse-temurin:25-jdk AS runtime
RUN useradd -m l2j
WORKDIR /l2j
COPY --from=builder /out/game /l2j
COPY game/entrypoint.sh /l2j/entrypoint.sh
RUN chmod +x /l2j/entrypoint.sh \
&& mkdir -p /l2j/log \
&& chown -R l2j:l2j /l2j
USER l2j
# Игровой порт (по умолчанию 7777) + порт телнета GM-консоли при необходимости
EXPOSE 7777
ENTRYPOINT ["/l2j/entrypoint.sh"]
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -euo pipefail
if [ -d /l2j/config_override ] && [ -n "$(ls -A /l2j/config_override 2>/dev/null)" ]; then
echo "[game] applying config overrides from /l2j/config_override"
find /l2j/config_override -type f | while read -r f; do
rel="${f#/l2j/config_override/}"
dest="/l2j/$rel"
mkdir -p "$(dirname "$dest")"
cp "$f" "$dest"
echo "[game] -> $dest"
done
fi
echo "[game] waiting for mysql at ${DB_HOST:-mysql}:${DB_PORT:-3306} ..."
until (echo > /dev/tcp/"${DB_HOST:-mysql}"/"${DB_PORT:-3306}") 2>/dev/null; do
sleep 2
done
echo "[game] waiting for loginserver at ${LOGIN_HOST:-loginserver}:${LOGIN_PORT:-9014} ..."
until (echo > /dev/tcp/"${LOGIN_HOST:-loginserver}"/"${LOGIN_PORT:-9014}") 2>/dev/null; do
sleep 2
done
echo "[game] dependencies are up, starting GameServer"
cd /l2j
CLASSPATH="libs/*"
if [ -f "libs/GameServer.jar" ]; then
exec java -Xms4g -Xmx4g -Dfile.encoding=UTF-8 -cp "$CLASSPATH" -jar libs/GameServer.jar
else
echo "[game] Не найден libs/GameServer.jar. Содержимое /l2j:"
find /l2j -maxdepth 2
exit 1
fi