fix(docker): update Makefile and compose for managed mode defaults (#86)

- Remove obsolete docker-compose.managed.yml reference from COMPOSE
- Add docker-compose.postgres.yml to default COMPOSE (required for managed mode)
- Add shared external network for cross-stack service discovery
- Add make targets: net, dev, migrate
- Fix UI healthcheck to use 127.0.0.1 instead of localhost

Co-authored-by: Viet Tran <viettranx@gmail.com>
This commit is contained in:
Thieu NguyenandViet Tran authored and GitHub committed 2026-03-09 07:06:01 +07:00
1 parent 137a986d4f
commit 1df0e518b6
4 files changed
+23 -4

No files matched your search

+12 -3
View File
@@ -2,7 +2,7 @@ VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
LDFLAGS = -s -w -X github.com/nextlevelbuilder/goclaw/cmd.Version=$(VERSION)
BINARY = goclaw
.PHONY: build run clean version up down logs reset test vet check-web setup ci
.PHONY: build run clean version net up down logs reset test vet check-web dev migrate setup ci
build:
CGO_ENABLED=0 go build -ldflags="$(LDFLAGS)" -o $(BINARY) .
@@ -19,7 +19,10 @@ version:
COMPOSE = docker compose -f docker-compose.yml -f docker-compose.postgres.yml -f docker-compose.selfservice.yml
UPGRADE = docker compose -f docker-compose.yml -f docker-compose.postgres.yml -f docker-compose.upgrade.yml
up:
net:
docker network inspect shared >/dev/null 2>&1 || docker network create shared
up: net
$(COMPOSE) up -d --build
$(UPGRADE) run --rm upgrade
@@ -29,7 +32,7 @@ down:
logs:
$(COMPOSE) logs -f goclaw
reset:
reset: net
$(COMPOSE) down -v
$(COMPOSE) up -d --build
@@ -42,6 +45,12 @@ vet:
check-web:
cd ui/web && pnpm install --frozen-lockfile && pnpm build
dev:
cd ui/web && pnpm dev
migrate:
$(COMPOSE) run --rm goclaw migrate up
setup:
go mod download
cd ui/web && pnpm install --frozen-lockfile
+3
View File
@@ -12,6 +12,9 @@ services:
dockerfile: Dockerfile
ports:
- "${GOCLAW_UI_PORT:-3000}:80"
networks:
- default
- shared
depends_on:
- goclaw
restart: unless-stopped
+7
View File
@@ -43,8 +43,15 @@ services:
memory: 1G
cpus: '2.0'
pids: 200
networks:
- default
- shared
restart: unless-stopped
volumes:
goclaw-data:
goclaw-workspace:
networks:
shared:
external: true
+1 -1
View File
@@ -27,4 +27,4 @@ COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD wget -qO- http://localhost:80/ || exit 1
CMD wget -qO- http://127.0.0.1:80/ || exit 1