Initial Docker-based game server setup for Sunshine and Steam.
Configure multi-player containers with GPU pinning, Moonlight-ready ports, and baseline project documentation. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
107
docker-compose.yml
Normal file
107
docker-compose.yml
Normal file
@@ -0,0 +1,107 @@
|
||||
x-game-template: &game-template
|
||||
build: .
|
||||
user: "root"
|
||||
restart: unless-stopped
|
||||
privileged: true
|
||||
ipc: shareable
|
||||
environment:
|
||||
NVIDIA_DRIVER_CAPABILITIES: all
|
||||
DISPLAY: ":99"
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '10'
|
||||
memory: 28g
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: 1
|
||||
capabilities: [gpu, compute, utility, video]
|
||||
# Добавляем healthcheck для лучшей стабильности
|
||||
healthcheck:
|
||||
test: ["CMD", "pgrep", "sunshine"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
services:
|
||||
player1:
|
||||
<<: *game-template
|
||||
container_name: game-player-1
|
||||
environment:
|
||||
NVIDIA_DRIVER_CAPABILITIES: all
|
||||
DISPLAY: ":99"
|
||||
NVIDIA_VISIBLE_DEVICES: "1"
|
||||
RENDER_DEVICE_INDEX: "0"
|
||||
ports:
|
||||
- "47984-47990:47984-47990/tcp"
|
||||
- "47998-48000:47998-48000/udp"
|
||||
volumes:
|
||||
- /DATA/AppData/game-server/players/p1_steam:/root/.local/share/Steam
|
||||
- /DATA/AppData/game-server/players/p1_config:/root/.config/sunshine
|
||||
# Добавляем логирование для отладки
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
player2:
|
||||
<<: *game-template
|
||||
container_name: game-player-2
|
||||
environment:
|
||||
NVIDIA_DRIVER_CAPABILITIES: all
|
||||
DISPLAY: ":99"
|
||||
NVIDIA_VISIBLE_DEVICES: "2"
|
||||
RENDER_DEVICE_INDEX: "0"
|
||||
ports:
|
||||
- "48014-48020:47984-47990/tcp"
|
||||
- "48028-48030:47998-48000/udp"
|
||||
volumes:
|
||||
- /DATA/AppData/game-server/players/p2_steam:/root/.local/share/Steam
|
||||
- /DATA/AppData/game-server/players/p2_config:/root/.config/sunshine
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
player3:
|
||||
<<: *game-template
|
||||
container_name: game-player-3
|
||||
environment:
|
||||
NVIDIA_DRIVER_CAPABILITIES: all
|
||||
DISPLAY: ":99"
|
||||
NVIDIA_VISIBLE_DEVICES: "3"
|
||||
RENDER_DEVICE_INDEX: "0"
|
||||
ports:
|
||||
- "48044-48050:47984-47990/tcp"
|
||||
- "48058-48060:47998-48000/udp"
|
||||
volumes:
|
||||
- /DATA/AppData/game-server/players/p3_steam:/root/.local/share/Steam
|
||||
- /DATA/AppData/game-server/players/p3_config:/root/.config/sunshine
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
player4:
|
||||
<<: *game-template
|
||||
container_name: game-player-4
|
||||
environment:
|
||||
NVIDIA_DRIVER_CAPABILITIES: all
|
||||
DISPLAY: ":99"
|
||||
NVIDIA_VISIBLE_DEVICES: "4"
|
||||
RENDER_DEVICE_INDEX: "0"
|
||||
ports:
|
||||
- "47974-47980:47984-47990/tcp"
|
||||
- "47968-47970:47998-48000/udp"
|
||||
volumes:
|
||||
- /DATA/AppData/game-server/players/p4_steam:/root/.local/share/Steam
|
||||
- /DATA/AppData/game-server/players/p4_config:/root/.config/sunshine
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
Reference in New Issue
Block a user