-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
153 lines (149 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
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
version: '3'
networks:
external:
name: external-network
external: true
internal:
name: internal-network
external: true
volumes:
db-dev:
fcrepo-dev:
solr-dev:
redis-dev:
bundled:
derivatives:
external:
name: mira_on_hyrax_derivatives
services:
##
# Basic Rails application build image
exhibits-app: &exhibits-app
build:
context: .
dockerfile: Dockerfile
user: root
volumes:
- .:/data # mount current directory into the image
- bundled:/usr/local/bundle
- derivatives:/data/tmp/derivatives
networks:
external:
internal:
# use tmpfs for tmp and log for performance and to allow
# multiple builds in parallel. Both directories are mounted
# into the image AFTER the working directory is mounted.
tmpfs:
- /data/log
##
# Development environment for application
exhibits-dev: &exhibits-dev
<<: *exhibits-app
environment:
- CACHE_PATH=/data/tmp/uploads/cache
- DB_NAME=development
- DB_HOST=exhibits-db-dev
- DB_PASSWORD=postgres
- DB_PORT='3306'
- DB_USERNAME=postgres
- DERIVATIVES_PATH=/data/tmp/derivatives
- FEDORA_URL=http://fcrepo-dev:8080/rest
- FITS_PATH=/opt/fits-1.0.5/fits.sh
- RAILS_ENV=development
- RAILS_LOG_TO_STDOUT=true
- REDIS_HOST=redis-dev
- REDIS_PORT=6379
- SECRET_KEY_BASE=bobross
- SOLR_URL=http://solr-dev:8983/solr/development
- UPLOADS_PATH=/data/tmp/uploads
depends_on:
- exhibits-db-dev
- chrome
expose:
- 4000
server:
<<: *exhibits-dev
command: >
bash -c "./build/entrypoint.sh &&
bundle exec rails s -p 4000 -b '0.0.0.0'"
ports:
- "${SERVER_PORTS}"
expose:
- "${SERVER_EXPOSE}"
##
# Test environment for application
test: &exhibits-test
<<: *exhibits-app
environment:
- CACHE_PATH=/data/tmp/uploads/cache
- IN_DOCKER=true
- HUB_URL=http://chrome:4444/wd/hub
- DB_NAME=test
- DB_HOST=exhibits-db-test
- DB_PASSWORD=postgres
- DB_PORT='3306'
- DB_USERNAME=postgres
- DERIVATIVES_PATH=/data/tmp/derivatives
- FEDORA_URL=http://fcrepo-test:8080/rest
- FITS_PATH=/opt/fits-1.0.5/fits.sh
- RAILS_ENV=test
- REDIS_HOST=redis-test
- REDIS_PORT=6379
- SECRET_KEY_BASE=bobross
- SOLR_URL=http://solr-test:8983/solr/test
- UPLOADS_PATH=/data/tmp/uploads
- DISABLE_SPRING=1
depends_on:
- exhibits-db-test
- chrome
volumes:
- .:/data # mount current directory into the image
- ./tmp:/tmp
- bundled:/usr/local/bundle
command: >
bash -c "./build/entrypoint.sh &&
RAILS_ENV=test bundle exec rails s -p 4001 -b '0.0.0.0'"
ports:
- "${TEST_PORTS}"
expose:
- "${TEST_EXPOSE}"
##
# Mariadb database server
db: &db
image: mariadb:10
networks:
internal:
exhibits-db-dev:
<<: *db
environment:
- MYSQL_DATABASE=development
- MYSQL_USER=postgres
- MYSQL_PASSWORD=postgres
- MYSQL_ROOT_PASSWORD=postgres
ports:
- 3317:3317
volumes:
- db-dev:/var/lib/mysql
exhibits-db-test:
<<: *db
environment:
- MYSQL_DATABASE=test
- MYSQL_USER=postgres
- MYSQL_PASSWORD=postgres
- MYSQL_ROOT_PASSWORD=postgres
ports:
- 3318:3318
tmpfs: /var/lib/mysql
chrome:
image: "${SELENIUM_IMAGE}"
platform: "${SELENIUM_PLATFORM}"
restart: always
logging:
driver: none
volumes:
- /dev/shm:/dev/shm
- ./tmp/downloads:/home/seluser/Downloads
shm_size: 2G
ports:
- "4434:4444"
- "5954:5900"