forked from xmlking/micro-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
144 lines (136 loc) · 3.49 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
141
142
143
144
version: "3"
services:
##############################
# consul
##############################
consul:
command: -server -bootstrap -rejoin
image: progrium/consul:latest
ports:
- "8300:8300"
- "8400:8400"
- "8500:8500"
- "8600:53/udp"
##############################
# nats
##############################
nats:
image: nats:latest
hostname: nats
ports:
- "4222:4222"
- "6222:6222"
- "8222:8222"
##############################
# postgres
##############################
postgres:
image: postgres:alpine
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres321
ports:
- "5432:5432"
healthcheck:
test:
[
"CMD-SHELL",
"psql postgres://$${POSTGRES_USER}:$${POSTGRES_PASSWORD}@localhost:5432/$${POSTGRES_DB} || exit 1",
]
volumes:
- postgres_data:/var/lib/postgresql/data
- ./deploy/bases/postgres/scripts/create_extensions.sh:/docker-entrypoint-initdb.d/10-create_extensions.sh:ro
##############################
# swagger
##############################
swagger:
image: swaggerapi/swagger-ui
environment:
SWAGGER_JSON: /swagger.yaml
ports:
- "8881:8080"
volumes:
- "./swagger/swagger.yaml:/swagger.yaml"
swagger-editor:
image: swaggerapi/swagger-editor
ports:
- "8882:8080"
##############################
# micro gateway
##############################
gateway:
# command: api --handler=web --namespace=go.micro.srv
# command: api --handler=api --namespace=go.micro.api
# command: api --handler=rpc --namespace=go.micro.srv
command: api --handler=rpc
image: microhq/micro:latest
environment:
MICRO_REGISTRY: consul
MICRO_REGISTRY_ADDRESS: "consul:8500"
MICRO_REGISTER_TTL: 10
MICRO_REGISTER_INTERVAL: 5
depends_on:
- consul
ports:
- "8080:8080"
##############################
# micro gateway for account-api
##############################
gateway-api:
# command: api --handler=web --namespace=go.micro.srv
# command: api --handler=api --namespace=go.micro.api
# command: api --handler=rpc --namespace=go.micro.srv
command: api --handler=api
image: microhq/micro:latest
environment:
MICRO_REGISTRY: consul
MICRO_REGISTRY_ADDRESS: "consul:8500"
MICRO_REGISTER_TTL: 10
MICRO_REGISTER_INTERVAL: 5
depends_on:
- consul
ports:
- "8081:8080"
##############################
# srv, api, web
##############################
account-srv:
image: xmlking/account-srv
environment:
MICRO_REGISTRY: consul
MICRO_REGISTRY_ADDRESS: "consul:8500"
# MICRO_TRANSPORT: nats
# MICRO_TRANSPORT_ADDRESS: "nats:4222"
# MICRO_BROKER: nats
# MICRO_BROKER_ADDRESS: "nats:4222"
# MICRO_REGISTRY: nats
# MICRO_REGISTRY_ADDRESS: "nats:4222"
depends_on:
- consul
# - nats
ports:
- "8881:8080"
emailer-srv:
image: xmlking/emailer-srv
environment:
MICRO_REGISTRY: consul
MICRO_REGISTRY_ADDRESS: "consul:8500"
depends_on:
- consul
ports:
- "8882:8080"
account-api:
image: xmlking/account-api
environment:
MICRO_REGISTRY: consul
MICRO_REGISTRY_ADDRESS: "consul:8500"
depends_on:
- consul
ports:
- "8883:8080"
##############################
# volumes
##############################
volumes:
postgres_data: