Files
tiennm99 4c56a23e58 feat: add Go game server with matchmaking, lobby, and WebSocket support
Implement a real-time game server using protobuf over WebSocket:
- Protobuf schema with 14 message types in oneof Envelope
- Room-based lobby with join/leave/chat broadcast
- ELO-based matchmaking with expanding range (±100 to ±500)
- Turn-based game session lifecycle management
- Multi-stage Docker build (Alpine)
- Unit tests for matchmaking and game session logic
2026-04-04 21:25:03 +07:00

14 lines
296 B
Docker

FROM golang:1.22-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /server ./cmd/server
FROM alpine:3.20
RUN apk add --no-cache ca-certificates
COPY --from=builder /server /server
EXPOSE 8080
ENTRYPOINT ["/server"]