This commit is contained in:
2026-08-10 02:04:45 +02:00
parent 39cb848f67
commit 593edf35fe
10 changed files with 394 additions and 33 deletions
+11 -1
View File
@@ -2,7 +2,11 @@ DATABASE_URL ?= postgres://descrybe:descrybe@localhost:5433/descrybe?sslmode=dis
GOOSE ?= go run github.com/pressly/goose/v3/cmd/goose@v3.24.1
SQLC ?= go run github.com/sqlc-dev/sqlc/cmd/sqlc@v1.29.0
.PHONY: migrate-up sqlc run worker migrator tidy test vet
.PHONY: migrate-up sqlc run worker migrator tidy test vet build build-lowmem
# Low-RAM compile defaults (~4GB hosts): one package at a time, capped GOMAXPROCS.
GO_BUILD_P ?= 1
GO_BIN_DIR ?= ../../bin
migrate-up:
$(GOOSE) -dir sql/schema postgres "$(DATABASE_URL)" up
@@ -27,3 +31,9 @@ test:
vet:
go vet ./...
# Sequential api + worker binaries into repo bin/ (see scripts/build.mjs).
build build-lowmem:
mkdir -p "$(GO_BIN_DIR)"
GOMAXPROCS=1 GOMEMLIMIT=768MiB GOGC=50 go build -p=$(GO_BUILD_P) -trimpath -ldflags="-s -w" -o "$(GO_BIN_DIR)/api" ./cmd/api
GOMAXPROCS=1 GOMEMLIMIT=768MiB GOGC=50 go build -p=$(GO_BUILD_P) -trimpath -ldflags="-s -w" -o "$(GO_BIN_DIR)/worker" ./cmd/worker