forked from thangchung/go-coffeeshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
executable file
·140 lines (131 loc) · 3.37 KB
/
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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
version: "3"
services:
postgres:
image: postgres:14-alpine
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=P@ssw0rd
healthcheck:
test: ["CMD", "pg_isready"]
ports:
- "5432:5432"
networks:
- coffeeshop-network
rabbitmq:
image: rabbitmq:3.11-management-alpine
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 30s
timeout: 30s
retries: 3
ports:
- "5672:5672"
- "15672:15672"
networks:
- coffeeshop-network
proxy:
build:
context: .
dockerfile: ./docker/Dockerfile-proxy
image: go-coffeeshop-proxy
environment:
APP_NAME: 'proxy-service in docker'
GRPC_PRODUCT_HOST: 'product'
GRPC_PRODUCT_PORT: 5001
GRPC_COUNTER_HOST: 'counter'
GRPC_COUNTER_PORT: 5002
ports:
- 5000:5000
depends_on:
- product
- counter
networks:
- coffeeshop-network
product:
build:
context: .
dockerfile: ./docker/Dockerfile-product
image: go-coffeeshop-product
environment:
APP_NAME: 'product-service in docker'
ports:
- 5001:5001
networks:
- coffeeshop-network
counter:
build:
context: .
dockerfile: ./docker/Dockerfile-counter
image: go-coffeeshop-counter
environment:
APP_NAME: 'counter-service in docker'
IN_DOCKER: "true"
PG_URL: postgres://postgres:P@ssw0rd@postgres:5432/postgres
PG_DSN_URL: host=postgres user=postgres password=P@ssw0rd dbname=postgres sslmode=disable
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672/
PRODUCT_CLIENT_URL: product:5001
ports:
- 5002:5002
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- coffeeshop-network
barista:
build:
context: .
dockerfile: ./docker/Dockerfile-barista
image: go-coffeeshop-barista
environment:
APP_NAME: 'barista-service in docker'
IN_DOCKER: "true"
PG_URL: postgres://postgres:P@ssw0rd@postgres:5432/postgres
PG_DSN_URL: host=postgres user=postgres password=P@ssw0rd dbname=postgres sslmode=disable
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672/
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- coffeeshop-network
kitchen:
build:
context: .
dockerfile: ./docker/Dockerfile-kitchen
image: go-coffeeshop-kitchen
environment:
APP_NAME: 'kitchen-service in docker'
IN_DOCKER: "true"
PG_URL: postgres://postgres:P@ssw0rd@postgres:5432/postgres
PG_DSN_URL: host=postgres user=postgres password=P@ssw0rd dbname=postgres sslmode=disable
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672/
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- coffeeshop-network
web:
build:
context: .
dockerfile: ./docker/Dockerfile-web
image: go-coffeeshop-web
environment:
REVERSE_PROXY_URL: http://localhost:5000
WEB_PORT: 8888
ports:
- 8888:8888
depends_on:
- proxy
networks:
- coffeeshop-network
networks:
coffeeshop-network: