build: add dev compose stack, container image and makefile

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-21 23:33:28 +01:00
1 parent 3b3879d9b5
commit 073668a5b4
4 files changed
+88

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo none)
PKG := git.zb-server.de/ZB-Server/uptimesebi
LDFLAGS := -s -w -X $(PKG)/internal/buildinfo.Version=$(VERSION) -X $(PKG)/internal/buildinfo.Commit=$(COMMIT)
.PHONY: generate web build test lint dev-up dev-down migrate image
generate:
sqlc generate
go tool templ generate
web:
npm run build
build: generate web
CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o bin/ ./cmd/...
test:
go test ./...
lint:
golangci-lint run
dev-up:
docker compose up -d --wait
dev-down:
docker compose down
migrate:
go run ./cmd/api migrate up
image:
docker build --build-arg VERSION=$(VERSION) --build-arg COMMIT=$(COMMIT) -t uptimesebi:$(VERSION) .