forked from nirgn975/angular-sanic-seed-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
153 lines (143 loc) · 3.23 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
version: "3"
services:
proxy:
image: dockercloud/haproxy
environment:
- BALANCE=leastconn
- EXTRA_GLOBAL_SETTINGS=debug
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 80:80
networks:
- example_cluster
deploy:
placement:
constraints: [node.role == manager]
database:
image: postgres
environment:
- POSTGRES_USER=nirgalon
- POSTGRES_PASSWORD=Zaq1234
- POSTGRES_DB=server
volumes:
- ./database:/etc/cron.daily
- /var/backups:/var/backups
deploy:
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
window: 20s
networks:
- example_cluster
client:
image: client
ports:
- "4200:4200"
environment:
- SERVICE_PORTS=4200
deploy:
replicas: 1
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
networks:
- example_cluster
server:
image: server
ports:
- "8000:8000"
environment:
- DEBUG=False
- DB_HOST=database
- DB_NAME=server
- DB_USER=nirgalon
- DB_PASS=Zaq1234
- SECRET_KEY=-#&29$$6a5n)za$$%q-9di^$$lxu5bvo!so=0e$$anel3o7^3oscz6
command: bash -c "/home/app/server/entrypoint.sh && gunicorn config.wsgi -b 0.0.0.0:8000"
deploy:
replicas: 2
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
depends_on:
- database
networks:
- example_cluster
visualizer:
image: dockersamples/visualizer:stable
ports:
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
deploy:
placement:
constraints: [node.role == manager]
networks:
- example_cluster
elasticsearch:
image: elasticsearch:5.4.3
command: elasticsearch
environment:
ES_JAVA_OPTS: -Xms1g -Xmx1g
ports:
- "9200:9200"
- "9300:9300"
ulimits:
memlock: -1
nofile:
hard: 65536
soft: 65536
nproc: 65538
volumes:
- esdata:/usr/share/elasticsearch/data:rw
networks:
- example_cluster
deploy:
mode: replicated
replicas: 1
healthcheck:
test: curl -s http://localhost:9200/_cluster/health | egrep 'yellow|green'
interval: 30s
retries: 1
kibana:
image: kibana:5.4.3
ports:
- "5601:5601"
environment:
ELASTICSEARCH_URL: http://elasticsearch:9200
networks:
- example_cluster
deploy:
mode: replicated
replicas: 1
healthcheck:
test: wget -qO- http://localhost:5601 > /dev/null
interval: 30s
retries: 1
logstash:
image: logstash:5.4.3
command: sh -c "logstash -e 'input { tcp { port => 5959 codec => json } } output { stdout { codec => rubydebug } elasticsearch { hosts => [ \"elasticsearch\" ] } }'"
ports:
- "5959:5959/tcp"
- "12201:12201/udp"
networks:
- example_cluster
deploy:
mode: replicated
replicas: 1
volumes:
esdata:
driver: local
networks:
example_cluster:
driver: overlay