Add tools/server/bd2-host.sh with setup, install, deploy, handoff, rollback and status commands so manual deploys and server-requested updates share one source check, image build, container switch and readiness check, with the image chosen only through .env. It reads host settings from /etc/bd2/host.conf, generates its systemd units instead of patching them, and copies a default Compose template on first install. Remove the separate bd2-docker-update script and units, ship bd2-host.sh and compose.yaml in the server package, and document one-click Docker deployment in the README.
28 lines
919 B
YAML
28 lines
919 B
YAML
# Default Compose file for bd2-host.sh. `bd2-host.sh install` copies it to
|
|
# /opt/bd2/compose.yaml once; edit that copy for your host. bd2-host.sh owns
|
|
# BD2_SERVER_IMAGE in /opt/bd2/.env, so keep the image line as it is.
|
|
services:
|
|
server:
|
|
image: ${BD2_SERVER_IMAGE:?bd2-host.sh deploy selects the image}
|
|
command: [serve, --listen, 0.0.0.0:8080, --data-dir, /app/data]
|
|
restart: unless-stopped
|
|
env_file:
|
|
- /opt/bd2/.env
|
|
ports:
|
|
# Publish behind an HTTPS reverse proxy; OAuth needs a public HTTPS origin.
|
|
- "127.0.0.1:8080:8080"
|
|
# Realtime multiplayer, when enabled in game.json:
|
|
# - "8444:8444/tcp"
|
|
# - "8444:8444/udp"
|
|
volumes:
|
|
- /opt/bd2/data:/app/data
|
|
read_only: true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,nodev,size=256m
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
pids_limit: 256
|
|
stop_grace_period: 90s
|