-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
143 lines (135 loc) · 4.09 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
version: '3.7'
services:
datashare-worker:
build:
context: .
target: worker
deploy:
mode: replicated
replicas: 2
depends_on:
datashare_web:
condition: service_started
environment:
DS_DOCKER_ML_LOG_LEVEL: DEBUG
DS_DOCKER_ES_ADDRESS: http://elasticsearch:9200
ICIJ_WORKER_TYPE: amqp
ICIJ_WORKER_RABBITMQ_HOST: rabbitmq
ICIJ_WORKER_RABBITMQ_PORT: 5672
volumes:
- type: bind
source: ${PWD}/.data
target: /home/user/src/app/.data
# Adding rabbitmq to distribute Datashare tasks
rabbitmq:
image: rabbitmq:3.12.0-management
# Set a host name to prevent rabbitmq to create new conf each time https://stackoverflow.com/a/53772874
hostname: rmq
container_name: datashare-rabbitmq
healthcheck:
test: rabbitmq-diagnostics -q status
interval: 5s
timeout: 2s
retries: 10
start_period: 5s
ports:
- "5672:5672"
- "15672:15672"
volumes:
- type: volume
source: rabbitmq-data
target: /var/lib/rabbitmq
# Unless commented, all lines below are copied from https://icij.gitbook.io/datashare/server-mode/install-with-docker
datashare_web:
# TODO: bump this to a version with serialization fixed
image: icij/datashare:19.0.0
hostname: datashare
ports:
- "8080:8080"
environment:
- DS_DOCKER_MOUNTED_DATA_DIR=${PWD}/data
volumes:
- type: bind
source: ${PWD}/.data/datashare
target: /home/datashare/Datashare
depends_on:
redis:
condition: service_healthy
elasticsearch:
condition: service_healthy
rabbitmq:
condition: service_healthy
# We need to switch the batchQueueType to AMQP and taskRoutingStrategy to Group compared to the default config
command: >-
--mode SERVER
--batchQueueType AMQP
--taskRoutingStrategy GROUP
--dataDir /home/datashare/Datashare
--pluginsDir /home/datashare/plugins
--extensionsDir /home/datashare/extensions
--authFilter org.icij.datashare.session.YesCookieAuthFilter
--dataSourceUrl jdbc:postgresql://postgresql/datashare?user=datashare\&password=password
--defaultProject test-project
--elasticsearchAddress http://elasticsearch:9200
--messageBusAddress amqp://guest:guest@rabbitmq:5672
--queueType REDIS
--redisAddress redis://redis:6379
--rootHost http://localhost:8080
--sessionStoreType REDIS
--sessionTtlSeconds 43200
--tcpListenPort 8080
elasticsearch:
image: elasticsearch:7.17.25
restart: on-failure
volumes:
- type: volume
source: elasticsearch-data
target: /usr/share/elasticsearch/data
read_only: false
environment:
- "http.host=0.0.0.0"
- "transport.host=0.0.0.0"
- "cluster.name=datashare"
- "discovery.type=single-node"
- "discovery.zen.minimum_master_nodes=1"
- "xpack.license.self_generated.type=basic"
- "http.cors.enabled=true"
- "http.cors.allow-origin=*"
- "http.cors.allow-methods=OPTIONS, HEAD, GET, POST, PUT, DELETE"
healthcheck:
test: [ "CMD-SHELL", "curl --silent --fail elasticsearch:9200/_cluster/health || exit 1" ]
ports:
- "9200:9200"
postgresql:
image: postgres:12-alpine
environment:
- POSTGRES_USER=datashare
- POSTGRES_PASSWORD=password
- POSTGRES_DB=datashare
# This is needed by the heathcheck command
# @see https://stackoverflow.com/a/60194261
- PGUSER=datashare
volumes:
- type: volume
source: postgresql-data
target: /var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready", "-U", "datashare", "-d", "datashare" ]
ports:
- "5432:5432"
redis:
image: ${REDIS_IMG}
restart: on-failure
volumes:
- type: volume
source: redis-data
target: /data
healthcheck:
test: [ "CMD-SHELL", "redis-cli", "--raw", "incr", "ping" ]
ports:
- "6379:6379"
volumes:
elasticsearch-data:
postgresql-data:
redis-data:
rabbitmq-data: