-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
86 lines (74 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
version: '3.5'
services:
# Services
consignment:
restart: always
build: ./consignment-service # shippy-service-consignment
depends_on:
- datastore
- user
- vessel
ports:
- "50051:50051"
environment:
MICRO_REGISTRY: "mdns"
MICRO_SERVER_ADDRESS: ":50051"
# We use datastore as the host name here instead of localHost
# because Docker has a powerful DNS mechanism built in.(http://dockone.io/article/2316)
DB_HOST: "mongodb://datastore:27017"
vessel:
restart: always
build: ./vessel-service # shippy-service-vessel
ports:
- "50052:50051"
environment:
MICRO_REGISTRY: "mdns"
MICRO_SERVER_ADDRESS: ":50051"
DB_HOST: "mongodb://datastore:27017"
# Commands
cli:
build: ./consignment-cli # shippy-cli-consignment
environment:
MICRO_REGISTRY: "mdns"
TOKEN: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VyIjp7ImVtYWlsIjoiZXdhbi52YWxlbnRpbmU4OUBnbWFpbC5jb20iLCJwYXNzd29yZCI6IlRlc3RpbmcxMjMifSwiaXNzIjoic2hpcHB5LnNlcnZpY2UudXNlciJ9.6tlhBVqRA0IJgmU_oTERV82STslpUJQKXoGOkd4-Ryc"
depends_on:
- consignment
user:
build: ./shippy-user-service
ports:
- "50053:50051"
environment:
MICRO_ADDRESS: ":50051"
DB_HOST: "database"
DB_USER: "admin"
DB_PASSWORD: "password"
DB_NAME: "postgres"
depends_on:
- database
user-cli:
build: ./shippy-cli-user
depends_on:
- user
# Database tier
datastore:
image: mongo
container_name: "datastore"
environment:
- MONGO_DATA_DIR=/data/db
- MONGO_LOG_DIR=/dev/null
volumes:
- ./data/db:/data/db # ensures data persistence between restarting
ports:
- "27017"
command: mongod --logpath=/dev/null
database:
image: postgres:alpine
environment:
POSTGRES_PASSWORD: "password"
POSTGRES_USER: "admin"
ports:
- "5432:5432"
networks: # Set up a custom network (default bridge mode). so that local containers can communicate with each other
default: # docker network create docker_compose_network --subnet 172.20.1.0/24ls
external:
name: docker_compose_network