-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
163 lines (151 loc) · 4.33 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
154
155
156
157
158
159
160
161
162
163
version: '3'
volumes:
app:
blazegraph:
db:
solr:
bundled:
networks:
external:
internal:
services:
##
# Basic image for the rails application server, see Dockerfile
app: &app
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/data
- app:/data/tmp/uploads
- bundled:/usr/local/bundle
tmpfs:
- /data/log
networks:
internal:
external:
##
# Run the application in the currently set RAILS_ENV, set to development by default in the .env file.
server: &server
<<: *app
environment:
- RAILS_ENV=${RAILS_ENV}
- CVM_SOLR_URL=http://localhost:8983/solr/default
- CVM_TRIPLESTORE_URL=http://localhost:9999/blazegraph/namespace/development/sparql
- BLAZEGRAPH_URL=http://localhost:9999/blazegraph
# Ideally we will replace this set of commands with an entrypoint script that checks to see if these
# have been run already have been run and if so it just starts the server without the first three commands
# taking time to run.
command: >
bash -c "bundle exec rake triplestore_adapter:blazegraph:reset &&
./build/entrypoint.sh &&
rake git_dev:create_dev_repo &&
rake sunspot:solr:start &&
bundle exec puma -C config/puma/development.rb --dir /data --pidfile /data/tmp/pids/puma.pid -b tcp://0.0.0.0:3000"
depends_on:
- db
- db_test
- solr
- blazegraph
expose:
- 3000
##
# Test environment for application
test: &test
<<: *server
environment:
- RAILS_ENV=test
- CVM_SOLR_URL=http://localhost:8983/solr/default
- CVM_TRIPLESTORE_URL=http://localhost:9999/blazegraph/namespace/test/sparql
- BLAZEGRAPH_URL=http://localhost:9999/blazegraph
depends_on:
- db_test
- solr-test
- blazegraph
command: >
bash -c "bundle exec rake triplestore_adapter:blazegraph:reset &&
./build/entrypoint.sh &&
rake git_dev:create_dev_repo &&
bundle exec puma -b tcp://0.0.0.0:3001 -e test"
expose:
- 3001
##
# Blazegraph server
blazegraph-image: &blazegraph-image
image: lyrasis/blazegraph:2.1.5
expose:
- 8080
networks:
internal:
command: bash -c "chmod a+wx /data && ./entrypoint.sh"
blazegraph:
<<: *blazegraph-image
volumes:
- blazegraph:/data
- ./config/blazegraph/RWStore.properties:/data/RWStore.properties
##
# Run an instance of MySQL with a database named 'development' for running specs. See config/database.yml
db:
image: mysql:5.7
restart: always
environment:
- MYSQL_ROOT_PASSWORD=12341234
- MYSQL_PASSWORD=12341234
- MYSQL_DATABASE=development
volumes:
- db:/var/lib/mysql
- ./config/mysql/mysqld.cnf:/etc/mysql/conf.d/custom.cnf
networks:
internal:
##
# Run an instance of MySQL with a database named 'test' for running specs. See config/database.yml. Has no volume
# and doesn't intend on persisting data across sessions.
db_test:
image: mysql:5.7
restart: always
environment:
- MYSQL_ROOT_PASSWORD=12341234
- MYSQL_PASSWORD=12341234
- MYSQL_DATABASE=test
volumes:
- ./config/mysql/mysqld.cnf:/etc/mysql/conf.d/custom.cnf
networks:
internal:
solr: &solr
image: solr:alpine
expose:
- 8983
volumes:
- solr:/opt/solr/server/solr/mycores
- ./solr/conf:/opt/solr/server/solr/configsets/_default/conf
entrypoint:
- docker-entrypoint.sh
- solr-precreate
- hydra-${RAILS_ENV}
networks:
internal:
##
# Run SOLR, precreating a core related to the RAILS_ENV currently set, persists data across sessions in a named volume.
solr-test:
<<: *solr
entrypoint:
- docker-entrypoint.sh
- solr-precreate
- hydra-test
##
# Load balancer, although not strictly necessary.. would allow the app to work with regular port 80
lb:
image: dockercloud/haproxy:1.5.3
links:
- server
environment:
- DOCKER_TLS_VERIFY
- DOCKER_HOST
- DOCKER_CERT_PATH
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# You must uncomment this line if and only if you are running docker-machine
# - $DOCKER_CERT_PATH:$DOCKER_CERT_PATH
networks:
internal:
external: