This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-stack.yml
76 lines (76 loc) · 1.67 KB
/
docker-stack.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
version: '3.4'
services:
nginx:
ports:
- protocol: tcp
mode: host
published: 80
target: 80
image: zeitnot/nginx:prod
volumes:
- assets:/var/www/poll/public
deploy:
placement:
constraints: [node.role == manager]
asset_compiler:
image: zeitnot/rails:prod
command: ["bundle","exec","rake", "assets:precompile"]
volumes:
- assets:/app/public
env_file:
- .env/production.env
deploy:
placement:
constraints: [node.role == manager]
restart_policy:
condition: none
migrator:
image: zeitnot/rails:prod
command: ["./wait-for","--timeout=300","db:5432","--","bin/rails","db:migrate"]
env_file:
- .env/production.env
deploy:
placement:
constraints: [node.role == manager]
restart_policy:
condition: none
db:
image: postgres:11.3
ports:
- "5432:5432"
volumes:
- db-data:/var/lib/postgresql/data
env_file:
- .env/production.env
deploy:
placement:
constraints: [node.role == manager]
rails:
image: zeitnot/rails:prod
stop_grace_period: 30s
ports:
- "3000:3000"
depends_on:
- db
env_file:
- .env/production.env
deploy:
replicas: 4
update_config:
delay: 20s
parallelism: 1
placement:
constraints: [node.role == worker]
visualizer:
image: dockersamples/visualizer:stable
ports:
- "8080:8080"
stop_grace_period: 1m30s
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
deploy:
placement:
constraints: [node.role == manager]
volumes:
db-data:
assets: