-
Notifications
You must be signed in to change notification settings - Fork 43
/
swarm.yml
135 lines (121 loc) · 3.01 KB
/
swarm.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
version: '3'
services:
caddy:
image: tsawler/micro-caddy:1.0.0
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.hostname == docker-desktop
volumes:
- caddy_data:/data
- caddy_config:/config
ports:
- "80:80"
- "444:443"
front-end:
image: tsawler/front-end:1.0.0
deploy:
mode: replicated
replicas: 1
# broker-service - main entry point; we call this from the front end
broker-service:
image: tsawler/broker-service:1.0.1
ports:
- "8080:80"
deploy:
mode: replicated
replicas: 1
# listener-service - watches rabbitmq for messages
listener-service:
image: tsawler/listener-service:1.0.0
deploy:
mode: replicated
replicas: 2
# authentication-service - handles user auth
authentication-service:
image: tsawler/authentication-service:1.0.0
deploy:
mode: replicated
replicas: 1
environment:
DSN: "host=postgres port=5432 user=postgres password=password dbname=users sslmode=disable timezone=UTC connect_timeout=5"
# logger-service: a service to store logs
logger-service:
image: tsawler/logger-service:1.0.0
ports:
- "8082:80"
deploy:
mode: replicated
replicas: 1
volumes:
- ./logger-service/templates/:/app/templates
# mail-service - handles sending mail
mail-service:
image: tsawler/mail-service:1.0.0
deploy:
mode: replicated
replicas: 1
environment:
MAIL_DOMAIN: localhost
MAIL_HOST: mailhog
MAIL_PORT: 1025
MAIL_ENCRYPTION: none
MAIL_USERNAME: ""
MAIL_PASSWORD: ""
FROM_NAME: "John Smith"
FROM_ADDRESS: [email protected]
# rabbitmq: the rabbitmq server
rabbitmq:
image: 'rabbitmq:3-management'
deploy:
mode: global
volumes:
- ./db-data/rabbitmq/:/var/lib/rabbitmq/
# mailhog: a fake smtp server with a web interface
mailhog:
image: 'mailhog/mailhog:latest'
ports:
- "8025:8025"
deploy:
mode: global
# mongo: start MongoDB and ensure that data is stored to a mounted volume
mongo:
image: 'mongo:4.2.17-bionic'
ports:
- "27017:27017"
deploy:
mode: global
environment:
MONGO_INITDB_DATABASE: logs
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: password
volumes:
- ./db-data/mongo/:/data/db
# postgres: start Postgres, and ensure that data is stored to a mounted volume
postgres:
image: 'postgres:14.2'
ports:
- "5432:5432"
deploy:
mode: global
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: users
volumes:
- ./db-data/postgres/:/var/lib/postgresql/data/
# etcd: start etcd server
etcd:
image: docker.io/bitnami/etcd:3
environment:
- ALLOW_NONE_AUTHENTICATION=yes
deploy:
mode: global
volumes:
- ./db-data/etcd/:/bitnami/etcd
volumes:
caddy_data:
external: true
caddy_config: