-
Notifications
You must be signed in to change notification settings - Fork 11
/
swarm.staging.yml
184 lines (171 loc) · 3.68 KB
/
swarm.staging.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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
version: '3.6'
services:
interface:
image: registry.curriculo.jurema.la/interface:latest
container_name: interface
env_file: .env.interface
build:
context: ./interface
args:
- APP_ENV=production
- API_URL=http://curriculo.jurema.la
networks:
- frontend
stdin_open: true
tty: true
restart: always
deploy:
placement:
constraints: [node.role == manager]
api:
image: registry.curriculo.jurema.la/api:latest
container_name: api
env_file:
- .env.postgresql
- .env.api.dev
build: ./api
stdin_open: true
tty: true
volumes:
- api_storage:/app/storage
links:
- postgresql
- elasticsearch
- jwt
depends_on:
- postgresql
- elasticsearch
- jwt
networks:
- backend
restart: always
secrets:
- POSTGRES_PASSWORD
- SECRET_KEY
- DEVISE_JWT_SECRET_KEY
deploy:
replicas: 2
update_config:
parallelism: 2
delay: 30s
restart_policy:
condition: on-failure
postgresql:
image: registry.curriculo.jurema.la/database:latest
container_name: postgresql
env_file: .env.postgresql
build:
context: .
dockerfile: ./conf/postgresql/Dockerfile
ports:
- 5432
networks:
- backend
volumes:
- postgresql_data:/var/lib/postgresql/data
restart: always
secrets:
- POSTGRES_PASSWORD
deploy:
placement:
constraints: [node.role == manager]
elasticsearch:
container_name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:6.5.4
env_file: .env.elasticsearch
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- backend
restart: always
deploy:
placement:
constraints: [node.role == manager]
nginx:
image: registry.curriculo.jurema.la/nginx:latest
container_name: nginx
build:
context: .
dockerfile: ./conf/nginx/Dockerfile
ports:
- 80:80
- 443:443
networks:
- frontend
- backend
volumes:
- certbot_data:/etc/letsencrypt
#volumes:
#- /var/run/docker.sock:/tmp/docker.sock:ro
# command: [nginx-debug, '-g', 'daemon off;']
depends_on:
- api
- interface
- certbot
links:
- api
- interface
- certbot
restart: always
deploy:
placement:
constraints: [node.role == manager]
certbot:
image: registry.curriculo.jurema.la/certbot:latest
container_name: certbot
build:
context: .
dockerfile: ./conf/certbot/Dockerfile
environment:
- DOMAIN=curriculo.jurema.la
- EMAIL=dev@jurema.la
networks:
- backend
volumes:
- certbot_data:/etc/letsencrypt
restart: always
deploy:
placement:
constraints: [node.role == manager]
visualizer:
image: dockersamples/visualizer:stable
ports:
- 8088:8080
stop_grace_period: 1m30s
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
placement:
constraints: [node.role == manager]
jwt:
image: registry.curriculo.jurema.la/jwt:latest
container_name: jwt
build: ./conf/jwt
ports:
- 8082:8082
networks:
- backend
env_file: .env.api.dev
stdin_open: true
tty: true
restart: always
deploy:
placement:
constraints: [node.role == manager]
volumes:
postgresql_data:
api_storage:
elasticsearch_data:
certbot_data:
networks:
frontend:
backend:
secrets:
SECRET_KEY:
external: true
DEVISE_JWT_SECRET_KEY:
external: true
POSTGRES_PASSWORD:
external: true