-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose-template.yml
executable file
·120 lines (116 loc) · 3.46 KB
/
docker-compose-template.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
version: '3.7'
services:
xnat-web1:
image: xnat1:latest
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints: [node.role == manager]
resources:
limits:
cpus: '2.5'
memory: 3500M
ports:
- "8104:8104"
- "8080:8080"
depends_on:
- xnat-db1
volumes:
# too slow
- "./volume/tomcat_logs1:/data/xnat/home/logs"
- "./volume/archive1:/data/xnat/archive"
- "./volume/scripts1:/data/xnat/scripts"
- "/var/run/docker.sock:/var/run/docker.sock"
- "@IMPORT_DATA_FOLDER@:/data/xnat/import_data"
#WINX- ./volume/postgres-data1:/pg_backup
# networks:
# - backend
xnat-db1:
image: postgres-xnat:latest
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints: [node.role == manager]
resources:
limits:
cpus: '1'
memory: 1000M
environment:
POSTGRES_USER: @PG_USER@
POSTGRES_PASSWORD: @PG_PWD@
POSTGRES_DB: xnat
command: postgres -c config_file=/etc/postgresql.conf
volumes:
- ./postgres/postgresql.conf:/etc/postgresql.conf
#LINUX - use original....
#LINX- ./volume/postgres-data1:/var/lib/postgresql/data
xnat-web2:
image: xnat2:latest
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints: [node.role == manager]
resources:
limits:
cpus: '0.9'
memory: 2000M
depends_on:
- xnat-db2
volumes:
# too slow
- "./volume/tomcat_logs2:/data/xnat/home/logs"
- "./volume/archive2:/data/xnat/archive"
- "./volume/scripts2:/data/xnat/scripts"
- "/var/run/docker.sock:/var/run/docker.sock"
#WINX- ./volume/postgres-data2:/pg_backup
# networks:
# - backend
xnat-db2:
image: postgres-xnat:latest
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints: [node.role == manager]
resources:
limits:
cpus: '0.5'
memory: 900M
environment:
POSTGRES_USER: @PG_USER@
POSTGRES_PASSWORD: @PG_PWD@
POSTGRES_DB: xnat
command: postgres -c config_file=/etc/postgresql.conf
volumes:
# default :consistent, so postgres identical on host and container
- ./postgres/postgresql.conf:/etc/postgresql.conf
#LINUX - use original....
#LINX- ./volume/postgres-data2:/var/lib/postgresql/data
xnat-nginx1:
image: nginx-xnat1:latest
deploy:
replicas: 1
resources:
limits:
cpus: "0.1"
memory: 100M
restart_policy:
condition: on-failure
volumes:
- "./volume/certificates:/etc/ssl"
- "./volume/nginx_logs:/var/log/nginx"
ports:
- "80:80"
- "8082:8082"
- "443:443"
- "444:444"
depends_on:
- xnat-web1
- xnat-web2