Annihilation-Gaming/docker-compose.yml

189 lines
8.8 KiB
YAML

# =============================================================================
# Selkies + Wine gaming nodes (LinuxServer.io winegui = Selkies streaming base)
#
# Faithfully recreating the spirit of Annihilation Gaming, found by wandering
# up the staircase in the middle of Boardwalk Arcade on the hill in Boulder
# in the mid-1990s.
#
# LAN on for eternity brothers!
# Dedicated to the memories of Gutshot and Mystic
#
# =============================================================================
# - Each node streams a Linux desktop with Wine/WineGUI to the browser.
# Node 1: https://<host>:3101 (accept the self-signed cert)
# - ALL Wine state (~/.wine prefix, installed games, saves) lives in the
# per-node /config bind mount on your HD; containers are disposable.
#
# ADDING A NODE LATER — copy any existing service block and change exactly 5
# things (all marked "NODE-SPECIFIC" below):
# 1. service name + container_name (wine3, selkies-wine3)
# 2. hostname -> becomes the Windows computer name
# (Wine uppercases it; keep <=15
# chars, letters/digits, no - or _)
# 3. WINE3_PORT in .env + ports mapping (one HTTPS port per node)
# 4. config volume path (.../nodes/wine3/config)
# 5. ipv4_address (pattern: 172.30.99.1N for wineN)
# Everything else comes from the x-wine-env / x-wine-node anchors below.
# To ADD or OVERRIDE env vars on one node, give that service an
# `environment:` block starting with `<<: *wine-env` plus only the extras
# (YAML merges maps, not lists — see the commented wine-retro example).
# Docs: https://docs.linuxserver.io/selkies/
# =============================================================================
x-wine-env: &wine-env
PUID: "${PUID:-1000}"
PGID: "${PGID:-1000}"
TZ: "${TZ:-America/Denver}"
# Basic auth for the web UI (LAN-grade only, do not expose to WAN as-is):
CUSTOM_USER: "${CUSTOM_USER:-abc}"
PASSWORD: "${PASSWORD:?Set PASSWORD in .env}"
# Browser file-transfer upload/download root -> lands on your HD:
FILE_MANAGER_PATH: /games
# Full-frame streaming mode (better for games/video; turn off if the plain
# desktop feels worse than the damage-tracking default):
SELKIES_VIDEO_STREAMING_MODE: "true"
x-wine-node: &wine-node
image: lscr.io/linuxserver/winegui:latest
shm_size: 2gb # shared memory for the display/stream buffers
restart: unless-stopped
environment: *wine-env
devices:
- /dev/dri:/dev/dri # Intel/AMD GPU passthrough (Iris Xe here).
# AUTO-detects render+encode (zero copy).
# Remove this line to run pure CPU.
# --- Optional knobs (add on a service via an environment override) ---------
# TITLE=Wine Node browser tab name per node
# LC_ALL=en_US.UTF-8 session language
# DRINODE=/dev/dri/renderD128 multi-GPU: pin renderer...
# DRI_NODE=/dev/dri/renderD128 ...and encoder (same device = zero copy)
# AUTO_GPU=false disable auto GPU detection
# --- NVIDIA host instead of Intel/AMD: drop the /dev/dri device line above
# and use this on the service (needs driver 580+ and nvidia container
# toolkit on the host):
# runtime: nvidia
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: all
# capabilities: [gpu]
services:
wine1:
<<: *wine-node
container_name: selkies-wine1 # NODE-SPECIFIC
hostname: wine1 # NODE-SPECIFIC — also the Windows computer
# name Wine reports (verified inside this
# container: `hostname` prints WINE1)
ports:
- "${WINE1_PORT:-3101}:3001" # NODE-SPECIFIC — HTTPS web UI + stream
# - "3100:3000" # plain HTTP only if you front it with
# your os-caddy reverse proxy later
# --- game ports (only needed when PHYSICAL PCs on the LAN join a game
# hosted by this node; container-to-container needs none of this).
# Repeat per game port, add /udp where the game uses UDP:
# - "3074:3074/tcp"
# - "3074:3074/udp"
volumes:
# Whole $HOME incl. the default Wine prefix (~/.wine): every installed
# game, bottle, and save file persists here on the HD.
- ${HD_DIR:?Set HD_DIR in .env}/nodes/wine1/config:/config # NODE-SPECIFIC
# Game installs / uploads / shared assets across nodes:
- ${GAMES_DIR:?Set GAMES_DIR in .env}:/games
networks:
gamelan:
ipv4_address: 172.30.99.11 # NODE-SPECIFIC — stable address for
# host/join fields; wineN -> 172.30.99.1N
# aliases: [game-host] # extra DNS name on this network
# ---------------------------------------------------------------------------
# wine2 — ready to uncomment when you add the second node. Isolated prefix,
# shared /games, and every other node can reach it as wine2, selkies-wine2,
# or 172.30.99.12 (all resolve inside the gamelan network).
# ---------------------------------------------------------------------------
# wine2:
# <<: *wine-node
# container_name: selkies-wine2
# hostname: wine2 # Windows computer name: WINE2
# ports:
# - "${WINE2_PORT:-3102}:3001"
# volumes:
# - ${HD_DIR}/nodes/wine2/config:/config
# - ${GAMES_DIR}:/games
# networks:
# gamelan:
# ipv4_address: 172.30.99.12
# ---------------------------------------------------------------------------
# wine-retro — dedicated node for old games capped at 1024x768 (or any fixed
# size). Pins the whole Linux session to that resolution so the game
# truescreens natively at its max res and Selkies stretches the video stream
# to fill your browser window (browser fullscreen; 4:3 content on a 16:9
# monitor gets letterboxed). Verified against this image: server logs report
# "fixed 1024x768" with these vars. Change W/H to 800x600 / 640x480 per era.
# Keep modern games on wine1/2 where the desktop follows browser size.
# ---------------------------------------------------------------------------
# wine-retro:
# <<: *wine-node
# container_name: selkies-wine-retro
# hostname: wineretro # <=15 chars, no hyphens (NetBIOS)
# environment:
# <<: *wine-env # inherit shared vars, then override/add:
# TITLE: Retro Games
# SELKIES_ENABLE_RESIZE: "false" # stop following browser size...
# SELKIES_MANUAL_RESOLUTION: "true" # ...and pin this instead:
# SELKIES_MANUAL_WIDTH: "1024"
# SELKIES_MANUAL_HEIGHT: "768"
# ports:
# - "${WINERETRO_PORT:-3109}:3001"
# volumes:
# - ${HD_DIR}/nodes/wine-retro/config:/config
# - ${GAMES_DIR}:/games
# networks:
# gamelan:
# ipv4_address: 172.30.99.40
# ---------------------------------------------------------------------------
# True LAN presence (optional upgrade): if a game ONLY does broadcast/
# multicast LAN discovery, or you want physical machines to reach the nodes
# without port mapping, replace `gamelan` on the services with `physlan`
# below. Give each node a real IP from a range outside OPNsense's DHCP
# pool. Caveats: macvlan containers can't talk to their own host, and the
# parent interface must be wired (check `ip -br link`).
# ---------------------------------------------------------------------------
# networks: # merges with the bottom block; keep
# gamelan: # gamelan for node-to-node if desired
# name: selkies-wine-gamelan
# physlan:
# name: selkies-wine-physlan
# driver: macvlan
# driver_opts:
# parent: enp0s31f6 # <-- your wired interface
# ipam:
# config:
# - subnet: 192.168.1.0/24
# gateway: 192.168.1.1 # OPNsense
# ip_range: 192.168.1.200/29
#
# then per service:
# networks:
# gamelan: {} # optional, node-to-node DNS keeps working
# physlan:
# ipv4_address: 192.168.1.201
# --- the shared game network ---------------------------------------------------
# All nodes in this file attach here by default: embedded DNS resolves every
# node by service name (wine1, wine2...) and container name (selkies-wine1...),
# and the fixed IPs below never change across rebuilds. Point-to-point host/join
# works on any port with zero extra config; broadcast discovery does not.
networks:
gamelan:
name: selkies-wine-gamelan
driver: bridge
ipam:
config:
- subnet: 172.30.99.0/24
gateway: 172.30.99.1