-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
38 lines (38 loc) · 913 Bytes
/
docker-compose.yaml
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
version: "3.9"
services:
postgres:
image: postgres:12-alpine
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=simple_bank
networks:
- bank-network
migrate:
image: migrate/migrate
volumes:
- ./db/migration:/migration
command: ["-path", "/migration", "-database", "postgresql://root:secret@postgres:5432/simple_bank?sslmode=disable", "-verbose", "up"]
depends_on:
- postgres
networks:
- bank-network
restart: on-failure
api:
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
environment:
- DB_SOURCE=postgresql://root:secret@postgres:5432/simple_bank?sslmode=disable
depends_on:
- postgres
- migrate
command: ["/app/main"]
networks:
- bank-network
networks:
bank-network:
name: bank-network
driver: bridge