-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
122 lines (115 loc) · 3.66 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
services:
haproxy:
container_name: $HAPROXY_DOCKER_NAME
restart: always
env_file: opensilex.env
build:
context: .
args:
HAPROXY_IMAGE_VERSION: $HAPROXY_IMAGE_VERSION
dockerfile: haproxy-build-step.docker
depends_on:
- opensilex
volumes:
- haproxy_conf:/usr/local/etc/haproxy
ports:
- "$HAPROXY_EXPOSED_PORT:80"
mongo:
container_name: $MONGO_DOCKER_NAME
image: mongo:$MONGO_IMAGE_VERSION
restart: always
env_file: opensilex.env
volumes:
- persist_mongo_data:/data
command: >
bash -c "
(
mongostat -n=1 &&
mongo --eval \"rs.initiate({'_id':'opensilex','members':[{'_id':0,'host':'opensilex-docker-mongodb:27017'}]})\" &&
wait
) & docker-entrypoint.sh --replSet opensilex
"
ports:
- "$MONGO_EXPOSED_PORT:27017"
rdf4j:
container_name: $RDF4J_DOCKER_NAME
env_file: opensilex.env
build:
context: .
args:
RDF4J_IMAGE_VERSION: $RDF4J_IMAGE_VERSION
dockerfile: rdf4j-build-step.docker
volumes:
- persist_rdf4j_data:/var/rdf4j
- persist_rdf4j_logs:/usr/local/tomcat/logs
ports:
- "$RDF4J_EXPOSED_PORT:8080"
mongoexpress:
image: mongo-express:$MONGO_EXPRESS_IMAGE_VERSION
container_name: $MONGO_EXPRESS_DOCKER_NAME
env_file: opensilex.env
restart: always
ports:
- "$MONGO_EXPRESS_EXPOSED_PORT:8081"
environment:
ME_CONFIG_MONGODB_SERVER: $MONGO_DOCKER_NAME
ME_CONFIG_MONGODB_URL: mongo://$MONGO_DOCKER_NAME:27017/
ME_CONFIG_SITE_BASEURL: "/$MONGO_EXPRESS_HOST"
depends_on:
- mongo
opensilex:
container_name: $OPENSILEX_DOCKER_NAME
build:
context: .
args:
OPENSILEX_RELEASE_TAG: $OPENSILEX_RELEASE_TAG
INTERNAL_DATA_DIRECTORY: $INTERNAL_DATA_DIRECTORY
dockerfile: opensilex-build-step.docker
env_file: opensilex.env
depends_on:
- mongo
- rdf4j
volumes:
- ./config:/home/opensilex/config
- ./logs/opensilex:/home/opensilex/logs
- persist_opensilex:/home/opensilex/data
- "$OPENSILEX_LOCAL_FILE_SYSTEM_DIRECTORY:$INTERNAL_DATA_DIRECTORY"
command: >
bash -c "
rm -f /home/opensilex/config/opensilex.yml &&
rm -f /home/opensilex/config/opensilex-template-custom.yml &&
cat /home/opensilex/config/opensilex-template.yml >> /home/opensilex/config/opensilex-template-custom.yml &&
cat /home/opensilex/config/opensilex-custom-config.yml >> /home/opensilex/config/opensilex-template-custom.yml &&
envsubst < /home/opensilex/config/opensilex-template-custom.yml > /home/opensilex/config/opensilex.yml &&
echo 'Running $OPENSILEX_START_CMD $OPENSILEX_START_CMD_DEBUG' &&
([ ! -f /home/opensilex/data/first_install ] && touch /home/opensilex/data/first_install && ./bin/opensilex.sh system install --CONFIG_FILE=/home/opensilex/config/opensilex.yml --DEBUG)
$OPENSILEX_START_CMD $OPENSILEX_START_CMD_DEBUG
"
ports:
- "$OPENSILEX_EXPOSED_PORT:8081"
# Stack part to start
start_opensilex_stack:
image: dadarek/wait-for-dependencies
depends_on:
- mongo
- rdf4j
- opensilex
command: mongo:27017 rdf4j:8080 opensilex:8081
start_opensilex_stack_mongogui:
image: dadarek/wait-for-dependencies
depends_on:
- mongoexpress
command: mongoexpress:8081
start_opensilex_stack_proxy:
image: dadarek/wait-for-dependencies
depends_on:
- haproxy
- opensilex
- mongoexpress
command: haproxy:80 opensilex:8081
volumes:
persist_rdf4j_data:
persist_rdf4j_logs:
persist_mongo_data:
persist_opensilex:
haproxy_conf: