-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
150 lines (139 loc) · 3.13 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
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
145
146
147
148
149
150
version: '3.4'
networks:
my-network:
driver: bridge
services:
# svc-account:
# build:
# context: ./account
# # dockerfile: ./Dockerfile
# deploy:
# replicas: 3
# depends_on:
# - mongo
# - nats
# - consul
# environment:
# - ES_HOST=mongo
# - ES_NAME=accounts
# - API_PORT=8000
# - NATS_ADDRESS=nats:4222
# - TOPIC=accounts
# - CONSUL_ADDRESS=consul:8500
# - PARTITION_SLOTS=1-2,3-4 # 4 partitions spread through 2 workers, 2 partitions each
# - PARTITIONS=4
# networks:
# - my-network
# ports:
# - 8000:8000
# - 3000:3000
# svc-balance:
# build:
# context: ./balance
# # dockerfile: ./Dockerfile
# deploy:
# replicas: 3
# depends_on:
# - nats
# - elastic
# - consul
# environment:
# - NATS_ADDRESS=nats:4222
# - TOPIC=accounts
# - CONSUL_ADDRESS=consul:8500
# - ES_ADDRESS=svc-forwarder:3000
# - ELASTIC_ADDRESSES=http://elastic:9200
# - PARTITIONS=4
# networks:
# - my-network
# ports:
# - 8030:8030
nats:
image: nats:2.6.6
command: -js
ports:
- "4222:4222"
- "8222:8222"
- "6222:6222"
networks:
- my-network
elastic:
image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
environment:
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ports:
- 9200:9200
- 9300:9300
networks:
- my-network
kibana:
image: docker.elastic.co/kibana/kibana:7.8.0
depends_on:
- elastic
ports:
- 5601:5601
environment:
ELASTICSEARCH_URL: http://elastic:9200
ELASTICSEARCH_HOSTS: http://elastic:9200
networks:
- my-network
# redis:
# image: "redis:alpine"
# ports:
# - "6379:6379"
# networks:
# - my-network
consul:
image: bitnami/consul:latest
ports:
- '8300:8300'
- '8301:8301'
- '8301:8301/udp'
- '8500:8500'
- '8600:8600'
- '8600:8600/udp'
networks:
- my-network
M1:
hostname: M1
container_name: M1
image: mongo:latest
environment:
# MONGO_INITDB_ROOT_USERNAME: root
# MONGO_INITDB_ROOT_PASSWORD: password
MONGO_INITDB_DATABASE: accounts
MONGO_REPLICA_SET_NAME: rs0
expose:
- 27017
ports:
- 27017:27017
restart: always
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]
mongo:
image: mongo:latest
links:
- M1:M1
depends_on:
- M1
volumes:
- ./scripts:/scripts
restart: "no"
entrypoint: [ "bash", "/scripts/mongo_setup.sh" ]
# mongo-express:
# image: mongo-express
# ports:
# - 8081:8081
# environment:
# ME_CONFIG_BASICAUTH_USERNAME: root
# ME_CONFIG_BASICAUTH_PASSWORD: password
# # ME_CONFIG_MONGODB_PORT: 27017
# # # ME_CONFIG_MONGODB_ADMINUSERNAME: root
# # # ME_CONFIG_MONGODB_ADMINPASSWORD: password
# ME_CONFIG_MONGODB_SERVER: "M1"
# depends_on:
# - mongo
# links:
# - mongo
# networks:
# - my-network