Docker Compose e Dokploy
Esegui rugen-server con il file compose fornito, su qualsiasi host Docker o come app Compose di Dokploy.
Il repository del server include deploy/docker-compose.yml. Esegue solo
rugen-server e pubblica le sue due porte; l’HTTPS davanti è una tua scelta
(i domini di Dokploy, qualsiasi reverse proxy, oppure l’
add-on Cloudflare Tunnel).
L’immagine è ghcr.io/rugen-dev/rugen-server:latest, pubblicata a ogni
tag v* (amd64; le build arm64 sono disponibili eseguendo manualmente il workflow
dell’immagine).
Docker Compose semplice
git clone https://github.com/rugen-dev/rugen-server
cd rugen-server/deploy
cp .env.example .env # optional: name, MOTD, public URL
docker compose up -d
Poi apri 7001/udp nel firewall dell’host. Verifica che sia attivo:
docker compose logs -f # "http + websocket on 0.0.0.0:8080", "udp relay advertised as ..."
curl http://localhost:8080/health
/health risponde con il nome del server, la versione, i giocatori online e lo stato dei backup.
Il file compose
name: rugen
services:
rugen-server:
# prebuilt image from GHCR (published on v* tags); or build locally:
image: ${RUGEN_IMAGE:-ghcr.io/rugen-dev/rugen-server:latest}
# build:
# context: ..
# dockerfile: deploy/Dockerfile
container_name: rugen-server
restart: unless-stopped
env_file:
- path: .env
required: false
environment:
RUGEN_BIND: 0.0.0.0:8080
RUGEN_UDP_BIND: ${RUGEN_UDP_BIND:-0.0.0.0:7001}
RUGEN_DATA: /data
volumes:
- rugen-data:/data
ports:
- "${RUGEN_HTTP_PORT:-8080}:8080"
# match relay fast path: open it in the host / VPS firewall too
- "${RUGEN_UDP_PORT:-7001}:7001/udp"
healthcheck:
test: ["CMD", "/rugen-server", "--healthcheck"]
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
networks:
- rugen
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
networks:
# fixed name so optional add-ons (deploy/cloudflared) can join it
rugen:
name: rugen
volumes:
rugen-data: {}
Tutto lo stato vive nel volume rugen-data: il database SQLite rugen.db
e i packages/ temporanei dei personaggi.
Dokploy
- Create Project → Create Service → Compose. Sorgente: il repository Git di rugen-server, percorso compose
deploy/docker-compose.yml(oppure incolla il file nell’editor Raw). - Scheda Environment (opzionale): incolla
deploy/.env.examplee impostaRUGEN_PUBLIC_URL,RUGEN_NAME,RUGEN_MOTD. Dokploy scrive.envaccanto al file compose; senza di esso vengono usati i valori predefiniti. - Scheda Domains: aggiungi
rugen.example.com→ serviziorugen-server, porta8080, HTTPS attivo (gli upgrade WebSocket passano attraverso Traefik). Salta questo passaggio se usi invece l’add-on Cloudflare Tunnel. - Apri 7001/udp nel firewall / security group del VPS.
- Deploy. I log mostrano
http + websocket on 0.0.0.0:8080eudp relay advertised as ...;https://rugen.example.com/healthrisponde.
Il file .env
# Public URL players put in rugen.toml ([net] server) or the ONLINE screen.
RUGEN_PUBLIC_URL=https://rugen.example.com
# Name and message of the day shown in the in-game server list.
RUGEN_NAME=my rugen server
RUGEN_MOTD=be nice, have fun
# Host:port players send UDP match traffic to. Must NOT go through
# Cloudflare's proxy. Empty = the host of RUGEN_PUBLIC_URL.
RUGEN_UDP_PUBLIC=
# RUGEN_UDP_BIND=off # WebSocket relay only, no open UDP port
RUST_LOG=info
# RUGEN_IMAGE=ghcr.io/rugen-dev/rugen-server:v0.3.0
# RUGEN_HTTP_PORT=8080
# RUGEN_UDP_PORT=7001
Ogni variabile è descritta in Configurazione.
Costruire l’immagine da te
Per compilare sul server invece di scaricare l’immagine, decommenta il blocco build: nel
file compose (e togli image: oppure punta RUGEN_IMAGE a un tag locale),
oppure compila direttamente dalla radice del repository:
docker build -f deploy/Dockerfile -t rugen-server .
docker build -f deploy/Dockerfile --build-arg FEATURES=resim -t rugen-server:resim .
L’immagine è un binario musl statico su scratch, eseguito come utente 65532 con
/data come volume. Senza shell né curl all’interno, il binario interroga
GET /health da sé per l’healthcheck (/rugen-server --healthcheck).
Senza proxy
Il compose pubblica già 8080 e 7001/udp: dai ai giocatori
http://your-ip:8080 e imposta RUGEN_UDP_PUBLIC=your-ip:7001. Funziona anche qualsiasi reverse
proxy con TLS; deve lasciar passare gli upgrade WebSocket per /ws e
/relay.
Qualcosa non va in questa pagina? Modificala su GitHub.