-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
65 lines (60 loc) · 1.44 KB
/
docker-compose.yml
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
60
61
62
63
64
65
version: '3'
services:
web-portal:
build:
context: ./services/web-portal
dockerfile: Dockerfile
ports:
- 8080:8080
restart: on-failure
depends_on:
- invoices
environment:
- INVOICES_GRPC_ADDRESS=invoices:8080
- APP_ENV=development
- PRIMARY_DB_URI=postgres://postgres:secret@postgres:5432/invoices?sslmode=disable
- DB_ROOT_USERNAME=postgres
- DB_PASSWORD=secret
networks:
- go-network
invoices:
build:
context: ./services/invoices
dockerfile: Dockerfile
ports:
- 8081:8080
restart: on-failure
depends_on:
postgres:
condition: service_healthy
environment:
- APP_ENV=development
- PRIMARY_DB_URI=postgres://postgres:secret@postgres:5432/invoices?sslmode=disable
- DB_USERNAME=postgres
- DB_ROOT_USERNAME=postgres
- DB_PASSWORD=secret
networks:
- go-network
postgres:
image: postgres:latest
ports:
- 5432:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: secret
POSTGRES_DB: invoices
volumes:
- postgres-data:/var/lib/postgresql/data
- ./postgres-config/pg_hba.conf:/etc/postgresql/pg_hba.conf
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
- go-network
volumes:
postgres-data:
networks:
go-network:
driver: bridge