-
Notifications
You must be signed in to change notification settings - Fork 74
/
docker-compose.yaml
88 lines (79 loc) · 2.24 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
version: '3.5'
services:
# We need the NATS really:
# - as the discovery service;
# - as the message broker service;
# - as the transport method (optional);
nats:
image: nats:2.1.9
ports:
- "4222:4222"
- "8222:8222"
- "6222:6222"
command:
- "-DV"
networks:
- go-micro-boilerplate-docker
restart: always
#--------------------------------------------------------------------------#
# SERVICES DEFINITIONS
#--------------------------------------------------------------------------#
# account-svc configures account-svc to run it locally.
account-svc:
build:
context: .
dockerfile: ./services/account-svc/Dockerfile
depends_on:
- nats
environment:
# This is the indicator that the service is running locally.
DOCKER_COMPOSE: "true"
# Define registry type and its address.
MICRO_REGISTRY: nats
MICRO_REGISTRY_ADDRESS: nats:4222
# Define transport type.
MICRO_TRANSPORT: nats
MICRO_TRANSPORT_ADDRESS: nats:4222
# Define message broker type and its address.
MICRO_BROKER: nats
MICRO_BROKER_ADDRESS: nats:4222
networks:
- go-micro-boilerplate-docker
restart: always
# rest-api-svc configures rest-api-svc to run it locally.
rest-api-svc:
build:
context: .
dockerfile: ./services/rest-api-svc/Dockerfile
depends_on:
- nats
- account-svc
ports:
- "3004:5678"
environment:
# This is the indicator that the service is running locally.
DOCKER_COMPOSE: "true"
# Define registry type and its address.
MICRO_REGISTRY: nats
MICRO_REGISTRY_ADDRESS: nats:4222
# Define transport type.
MICRO_TRANSPORT: nats
MICRO_TRANSPORT_ADDRESS: nats:4222
# Define message broker type and its address.
MICRO_BROKER: nats
MICRO_BROKER_ADDRESS: nats:4222
networks:
- go-micro-boilerplate-docker
restart: always
cvspot-api-spec:
image: swaggerapi/swagger-ui
ports:
- "4005:8080"
environment:
SWAGGER_JSON: /spec/swagger.yaml
volumes:
- ./services/rest-api-svc/specs:/spec
networks:
go-micro-boilerplate-docker:
driver: bridge
name: go-micro-boilerplate-docker