-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
162 lines (151 loc) · 5.57 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
151
152
153
154
155
156
157
158
159
160
161
162
version: '3.4'
#Creates a Docker swarm for nats-streaming-server:
#Reference: https://docs.nats.io/nats-streaming-server/swarm
#Running for the first time? Run: docker swarm init
# If you don't want to run in Docker containers:
# 1) Change URLs in appsettings.json in NatsNlogConsumerExample & NatsNlogPublisherExample
# 2) Change <ActiveDebugProfile>Docker</ActiveDebugProfile> in NatsNlogConsumerExample.csproj.user & NatsNlogPublisherExample.csproj.user to <ActiveDebugProfile>Debug</ActiveDebugProfile>
# 3) Use the NatsStreamServerInstaller project to setup/configure Windows services for NATS Streaming Server cluster
networks:
nats-streaming-example:
attachable: true
driver: overlay
services:
ravendb-withdata:
image: ravendb/ravendb
ports:
- "8080:8080"
- "38888:38888"
volumes:
- "/c/RavenDb/Config:/opt/RavenDB/config"
- "/c/RavenDb/Data:/opt/RavenDB/Server/RavenData"
environment:
- "RAVEN_Setup_Mode=None"
#- "RAVEN_ARGS=--Setup.Mode=None"
- "RAVEN_ARGS=--log-to-console"
- "RAVEN_License_Eula_Accepted=true"
- "RAVEN_Security_UnsecuredAccessAllowed=PrivateNetwork"
nats-cluster-node-A:
image: nats:latest
restart: always
command: "-cluster nats://0.0.0.0:6222 -routes nats://nats-cluster-node-A:6222,nats://nats-cluster-node-B:6222,nats://nats-cluster-node-C:6222"
networks:
- nats-streaming-example
nats-cluster-node-B:
image: nats:latest
restart: always
command: "-cluster nats://0.0.0.0:6222 -routes nats://nats-cluster-node-A:6222,nats://nats-cluster-node-B:6222,nats://nats-cluster-node-C:6222"
networks:
- nats-streaming-example
nats-cluster-node-C:
image: nats:latest
restart: always
command: "-cluster nats://0.0.0.0:6222 -routes nats://nats-cluster-node-A:6222,nats://nats-cluster-node-B:6222,nats://nats-cluster-node-C:6222"
networks:
- nats-streaming-example
nats-streaming-node-A:
image: nats-streaming:latest
restart: always
expose:
- "4222"
- "8222"
- "6221"
ports:
- "4222"
- "8222"
- "6221:6221"
hostname: "nats-node-A"
volumes:
- "/c/logs:/logs"
- "/c/nats/shareddatastore-A:/nats/shareddatastore-A"
- "/c/nats/cluster/nats-cluster-node-A:/cluster/nats-cluster-node-A"
command: "-p 4222 -store file -dir /nats/shareddatastore-A -clustered -cluster_id test-cluster -cluster_node_id node-A -cluster_log_path /cluster/nats-cluster-node-A -cluster_peers node-A,node-B,node-C -nats_server nats://nats-cluster-node-A:4222,nats://nats-cluster-node-B:4222,nats://nats-cluster-node-C:4222 -l /logs/nats-node-A.log -DV"
networks:
- nats-streaming-example
depends_on:
- nats-cluster-node-A
- nats-cluster-node-B
- nats-cluster-node-C
nats-streaming-node-B:
image: nats-streaming:latest
restart: always
expose:
- "4222"
- "6222"
ports:
- "4222"
- "6222:6222"
hostname: "nats-node-B"
volumes:
- "/c/logs:/logs"
- "/c/nats/shareddatastore-B:/nats/shareddatastore-B"
- "/c/nats/cluster/nats-cluster-node-B:/cluster/nats-cluster-node-B"
command: "-p 4222 -store file -dir /nats/shareddatastore-B -clustered -cluster_id test-cluster -cluster_node_id node-B -cluster_log_path /cluster/nats-cluster-node-B -cluster_peers node-A,node-B,node-C -nats_server nats://nats-cluster-node-A:4222,nats://nats-cluster-node-B:4222,nats://nats-cluster-node-C:4222 -l /logs/nats-node-B.log -DV"
networks:
- nats-streaming-example
depends_on:
- nats-cluster-node-A
- nats-cluster-node-B
- nats-cluster-node-C
nats-streaming-node-C:
image: nats-streaming:latest
restart: always
expose:
- "4222"
- "6222"
ports:
- "4222"
- "6223:6223"
hostname: "nats-node-C"
volumes:
- "/c/logs:/logs"
- "/c/nats/shareddatastore-C:/nats/shareddatastore-C"
- "/c/nats/cluster/nats-cluster-node-C:/cluster/nats-cluster-node-C"
command: "-p 4222 -store file -dir /nats/shareddatastore-C -clustered -cluster_id test-cluster -cluster_node_id node-C -cluster_log_path /cluster/nats-cluster-node-C -cluster_peers node-A,node-B,node-C -nats_server nats://nats-cluster-node-A:4222,nats://nats-cluster-node-B:4222,nats://nats-cluster-node-C:4222 -l /logs/nats-node-C.log -DV"
networks:
- nats-streaming-example
depends_on:
- nats-cluster-node-A
- nats-cluster-node-B
- nats-cluster-node-C
natsnlogconsumerexample:
image: ${DOCKER_REGISTRY-}natsnlogconsumerexample
stdin_open: true
tty: true
build:
context: .
dockerfile: NatsNlogConsumerExample/Dockerfile
ports:
- "4222"
volumes:
- type: bind
source: "/c/logs"
target: "/c/logs"
networks:
- nats-streaming-example
depends_on:
- natsnlogpublisherexample
- ravendb-withdata
environment:
- "isdockercontainer=true"
natsnlogpublisherexample:
image: ${DOCKER_REGISTRY-}natsnlogpublisherexample
stdin_open: true
tty: true
build:
context: .
dockerfile: NatsNlogPublisherExample/Dockerfile
ports:
- "4222"
volumes:
- type: bind
source: "/c/logs"
target: "/c/logs"
networks:
- nats-streaming-example
depends_on:
- nats-streaming-node-A
- nats-streaming-node-B
- nats-streaming-node-C
environment:
- "isdockercontainer=true"