# GoSpeak Docker Compose # # Usage: # podman compose up — run the server # podman compose up --build — rebuild and run # podman compose --profile build run --build builder — all binaries → ./bin/ # podman compose --profile build-win run --build builder-win — Windows only → ./bin/ # podman compose --profile build-lin run --build builder-lin — Linux only → ./bin/ # podman compose --profile dev run --build lint — golangci-lint # podman compose --profile dev run --build test — go test -race # See compose.monitoring.yaml for the opt-in Prometheus + Grafana stack. # # NOTE: always use --build on "run" to ensure the latest source is compiled. # # Works with: Docker Compose v2, Podman Compose, podman-compose services: server: build: context: . dockerfile: Containerfile target: server image: gospeak-server container_name: gospeak-server ports: - "9600:9600" # TCP/TLS control plane - "9601:9601/udp" # UDP voice plane - "9603:9603" # TCP/TLS screen-share plane (used when -screen-share is enabled) command: ["-metrics", "${GOSPEAK_METRICS_ADDR:-}"] volumes: - ./data:/data cap_drop: - ALL security_opt: - no-new-privileges:true restart: unless-stopped # One-shot service to extract ALL cross-compiled binaries. builder: build: context: . dockerfile: Containerfile target: builder image: gospeak-builder profiles: - build volumes: - ./bin:/export entrypoint: ["/bin/sh", "-c"] command: - | cp /out/gospeak-server /export/ && \ cp /out/gospeak-server-win.exe /export/ && \ cp /out/gospeak-client-lin /export/ && \ cp /out/gospeak-client-win.exe /export/ && \ echo "All binaries exported to ./bin/" # One-shot: Windows binaries only (faster for local dev). builder-win: build: context: . dockerfile: Containerfile target: builder-win image: gospeak-builder-win profiles: - build-win volumes: - ./bin:/export entrypoint: ["/bin/sh", "-c"] command: - | cp /out/gospeak-server-win.exe /export/ && \ cp /out/gospeak-client-win.exe /export/ && \ echo "Windows binaries exported to ./bin/" # One-shot: Linux binaries only (faster for local dev). builder-lin: build: context: . dockerfile: Containerfile target: builder-lin image: gospeak-builder-lin profiles: - build-lin volumes: - ./bin:/export entrypoint: ["/bin/sh", "-c"] command: - | cp /out/gospeak-server /export/ && \ cp /out/gospeak-client-lin /export/ && \ echo "Linux binaries exported to ./bin/" # One-shot: run golangci-lint inside the build container. lint: build: context: . dockerfile: Containerfile target: builder image: gospeak-lint profiles: - dev working_dir: /build entrypoint: ["/bin/sh", "-c"] command: - | gofmt -w . && \ go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2 && \ golangci-lint run ./... # One-shot: run Go tests inside the build container. test: build: context: . dockerfile: Containerfile target: builder image: gospeak-test profiles: - dev working_dir: /build entrypoint: ["/bin/sh", "-c"] command: - | gofmt -w . && \ go test -v -tags nolibopusfile -race -timeout=5m ./...