mirror of
https://github.com/tiennm99/gomoku.git
synced 2026-05-24 08:25:16 +00:00
5ccd4e7ce2
Rewrite README with usage guide, deployment instructions, and protocol docs. Update CLAUDE.md to reflect gomoku-only architecture. Add English doc comments to all key server Go files, replacing Chinese comments. Create docs/system-architecture.md (state machine, protocol, database schema) and docs/deployment-guide.md (local dev, Docker, production nginx, resource requirements). Update Dockerfile to Go 1.22 with repo-root build context to include web client. Update docker-compose to match.
43 lines
978 B
YAML
43 lines
978 B
YAML
version: '3.8'
|
|
|
|
services:
|
|
gomoku-server:
|
|
build:
|
|
# Build from repo root so Dockerfile can access both server/ and web/
|
|
context: ..
|
|
dockerfile: server/Dockerfile
|
|
image: gomoku-server:latest
|
|
container_name: gomoku-server
|
|
restart: unless-stopped
|
|
ports:
|
|
- "9998:9998" # WebSocket + web UI
|
|
- "9999:9999" # TCP (CLI client)
|
|
environment:
|
|
- TZ=Asia/Shanghai
|
|
networks:
|
|
- gomoku-network
|
|
command: ["./gomoku-server", "-w", "9998", "-t", "9999", "-s", "./web"]
|
|
healthcheck:
|
|
test: ["CMD", "nc", "-z", "localhost", "9998"]
|
|
interval: 30s
|
|
timeout: 3s
|
|
retries: 3
|
|
start_period: 10s
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '2'
|
|
memory: 512M
|
|
reservations:
|
|
cpus: '0.5'
|
|
memory: 128M
|
|
|
|
networks:
|
|
gomoku-network:
|
|
driver: bridge
|