-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (35 loc) · 1.04 KB
/
Makefile
File metadata and controls
47 lines (35 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
APP_NAME=project-flow-api
COMPOSE=docker compose
.PHONY: help run up down restart logs ps migrate test fmt vet
## help: Show available commands
help:
@awk 'BEGIN {FS = ":.*"} /^## / {help = substr($$0, 4)} /^[a-zA-Z_-]+:/ && help {printf "\033[36m%-12s\033[0m %s\n", $$1, help; help = ""}' $(MAKEFILE_LIST)
## run: Run API in foreground (build + logs)
run:
$(COMPOSE) up --build api
## up: Start all services in background
up:
$(COMPOSE) up -d --build
## down: Stop all services
down:
$(COMPOSE) down
## restart: Restart all services
restart: down up
## logs: Follow API logs
logs:
$(COMPOSE) logs -f api
## ps: Show running containers
ps:
$(COMPOSE) ps
## migrate: Run database migrations
migrate:
$(COMPOSE) run --rm migrate
## test: Run Go tests in container
test:
docker run --rm -v $(PWD):/app -w /app golang:1.24.2-alpine go test ./...
## fmt: Format Go code
fmt:
docker run --rm -v $(PWD):/app -w /app golang:1.24.2-alpine go fmt ./...
## vet: Run go vet
vet:
docker run --rm -v $(PWD):/app -w /app golang:1.24.2-alpine go vet ./...