-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (43 loc) · 1.1 KB
/
Makefile
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
48
49
50
51
52
53
54
55
56
57
58
59
project_name = golang-backend-template
image_name = golang-backend-template:latest
include .env
export
POSTGRES_IMAGE_NAME = postgres:latest
POSTGRES_CONTAINER_NAME = postgres-db
run-local:
go fmt ./backend/... && gosec ./backend/... && air main.go
docs-generate:
swag init
requirements:
go mod tidy
cd frontend
npm install
clean-packages:
go clean -modcache
build-backend:
docker build -t $(image_name) ./backend
run-frontend:
cd frontend; npm run dev
stop-postgres:
docker stop $(POSTGRES_CONTAINER_NAME)
docker rm $(POSTGRES_CONTAINER_NAME)
start-postgres:
docker run --name $(POSTGRES_CONTAINER_NAME) --env-file .env -d -p 5432:5432 $(POSTGRES_IMAGE_NAME)
start:
make start-postgres
docker run -d -p 8000:8000 --env-file .env --link $(POSTGRES_CONTAINER_NAME):postgres $(image_name)
cd ./frontend
bun install
npm run dev
build-no-cache:
docker build --no-cache -t $(image_name) .
service-stop:
docker compose down
service-start:
make service-stop
docker compose up
reset-data:
rm -r postgres-data
integration-test:
make start
go clean -testcache && go test -v ./integration-test/...