Skip to content

Commit f2fe58c

Browse files
committed
test: add compose file
1 parent db1f329 commit f2fe58c

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@
1212
"LOG_LEVEL": "debug"
1313
},
1414
"console": "integratedTerminal"
15+
},
16+
{
17+
"name": "Run API (postgresql in compose)",
18+
"type": "go",
19+
"request": "launch",
20+
"mode": "auto",
21+
"cwd": "${workspaceFolder}",
22+
"program": "${workspaceFolder}/main.go",
23+
"env": {
24+
"LOG_LEVEL": "debug",
25+
"DB_HOST": "localhost",
26+
"DB_USER": "ez",
27+
"DB_PASSWORD": "thisisunsafe",
28+
"DB_NAME": "postgres"
29+
},
30+
"console": "integratedTerminal"
1531
}
1632
]
1733
}

docker-compose.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: "3"
2+
3+
services:
4+
db:
5+
image: postgres:14.2-alpine
6+
restart: always
7+
environment:
8+
- POSTGRES_USER=ez
9+
- POSTGRES_PASSWORD=thisisunsafe
10+
ports:
11+
- 5432:5432
12+
volumes:
13+
- db:/var/lib/postgresql/data
14+
15+
backend:
16+
build: .
17+
depends_on:
18+
- db
19+
ports:
20+
- 8080:8080
21+
environment:
22+
GIN_MODE: debug
23+
DB_HOST: db
24+
DB_USER: ez
25+
DB_PASSWORD: thisisunsafe
26+
DB_NAME: postgres
27+
28+
volumes:
29+
db:

0 commit comments

Comments
 (0)