add telegram bot and autossh tunnel

This commit is contained in:
2026-05-11 21:51:59 +02:00
parent b4c26f39f0
commit 9ac3705d5e
9 changed files with 1050 additions and 5 deletions

View File

@@ -2,8 +2,8 @@ services:
minecraft:
image: itzg/minecraft-server:latest
container_name: minecraft
ports:
- "25565:25565"
expose:
- "25565"
environment:
EULA: "TRUE"
ONLINE_MODE: "FALSE"
@@ -15,3 +15,29 @@ services:
restart: unless-stopped
stdin_open: true
tty: true
autossh:
image: jnovack/autossh:2.0.1
container_name: minecraft-autossh
restart: unless-stopped
depends_on:
- minecraft
environment:
SSH_REMOTE_USER: root
SSH_REMOTE_HOST: spotbotdev1.dedicated.co.za
SSH_REMOTE_PORT: "22"
SSH_BIND_IP: "0.0.0.0" # bind on the *remote* (spotbot) public iface
SSH_TUNNEL_PORT: "25565" # spotbot:25565 (public side) …
SSH_TARGET_HOST: "minecraft" # → service name on the compose network …
SSH_TARGET_PORT: "25565" # → minecraft container's :25565
SSH_MODE: "-R"
SSH_KEY_FILE: "/id_rsa"
SSH_KNOWN_HOSTS_FILE: "/known_hosts"
SSH_SERVER_ALIVE_INTERVAL: "20"
SSH_SERVER_ALIVE_COUNT_MAX: "3"
AUTOSSH_GATETIME: "0"
AUTOSSH_PORT: "0" # disable monitoring port; rely on ServerAlive
AUTOSSH_LOGLEVEL: "1"
volumes:
- ./ssh/spotbot_key:/id_rsa:ro
- ./ssh/known_hosts:/known_hosts:ro