-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-stack.yml
131 lines (119 loc) · 3.53 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
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
# Docker Compose file to start a full RECYCLUS node.
#
# Required env variables:
#
# RECYCLUS_CONFIG : points to the root RECYCLUS configuration directory
# example: export RECYCLUS_CONFIG=/Users/yarden/RECYCLUS_CONFIG
# RECYCLUS_HOSTNAME: HostName or IP address for apache httpd front-end server
# example: export RECYCLUS_HOSTNAME=my.recyclus.node
# example: export RECYCLUS_HOSTNAME=`docker-machine ip`
# RECYCLUS_VERSION: version of RECYCLUS/Docker distribution
# example: export RECYCLUS_VERSION=1.0
version: "3.4"
secrets:
gateway-ca-bundle:
file: $RECYCLUS_CONFIG/certificates/recyclus-trust-bundle.pem
gateway-certificates_crt:
file: $RECYCLUS_CONFIG/certificates//hostcert/hostcert.crt
gateway-certificates_key:
file: $RECYCLUS_CONFIG/certificates//hostcert/hostcert.key
gateway-jwt-key:
file: $RECYCLUS_CONFIG/secrets/jwt-key
mongo-admin:
file: $RECYCLUS_CONFIG/secrets/mongo-admin
mongo-password:
file: $RECYCLUS_CONFIG/secrets/mongo-password
services:
redis:
image: "redis:alpine"
command: redis-server --appendonly yes
volumes:
- redis:/data
networks:
- cyclus
deploy:
placement:
constraints: [node.role == manager]
batch:
image: ${RECYCLUS_HUB}/recyclus-batch:${RECYCLUS_VERSION-latest}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- cyclus
deploy:
mode: replicated
replicas: 1
worker:
image: ${RECYCLUS_HUB}/recyclus-worker:${RECYCLUS_VERSION-latest}
networks:
- cyclus
deploy:
mode: replicated
replicas: 3
datastore:
image: ${RECYCLUS_HUB}/recyclus-datastore:${RECYCLUS_VERSION-latest}
secrets:
- source: mongo-admin
target: /recyclus/secrets/mongo-admin
- source: mongo-password
target: /recyclus/secrets/mongo-password
environment:
MONGO_INITDB_ROOT_USERNAME_FILE: /recyclus/secrets/mongo-admin
MONGO_INITDB_ROOT_PASSWORD_FILE: /recyclus/secrets/mongo-password
volumes:
- datastore-files:/files
networks:
- cyclus
deploy:
mode: replicated
replicas: 1
# placement:
# constraints: [node.labels.recylcus_datastore == true]
datastore-db:
image: "mongo:latest"
secrets:
- source: mongo-admin
target: /recyclus/secrets/mongo-admin
- source: mongo-password
target: /recyclus/secrets/mongo-password
environment:
MONGO_INITDB_ROOT_USERNAME_FILE: /recyclus/secrets/mongo-admin
MONGO_INITDB_ROOT_PASSWORD_FILE: /recyclus/secrets/mongo-password
volumes:
- datastore-info:/data/db
networks:
- cyclus
deploy:
mode: replicated
replicas: 1
# placement:
# constraints: [node.labels.recylcus_datastore_db == true]
gateway:
image: ${RECYCLUS_HUB}/recyclus-gateway:${RECYCLUS_VERSION-latest}
ports:
- "5000:80"
secrets:
# - source: gateway-ca-bundle
# target: /recyclus/certificates/recyclus-trust-bundle.pem
- source: gateway-certificates_crt
target: /recyclus/certificates/hostcert.crt
- source: gateway-certificates_key
target: /recyclus/certificates/hostcert.key
- source: gateway-jwt-key
target: /recyclus/secrets/jwt-key
environment:
JWT_SECRET_KEY_FILE: /recyclus/secrets/jwt-key
volumes:
- gateway-db:/data
networks:
- cyclus
deploy:
placement:
constraints: [node.role == manager]
networks:
cyclus:
volumes:
redis:
gateway-db:
datastore-files:
datastore-info: