-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
executable file
·47 lines (44 loc) · 1.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
version: '3'
# docker-compose up
services:
db:
image: library/postgres:9.6
ports:
- "5432:5432"
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- "~/.aad/pgdata:/var/lib/postgresql/data"
# - "~/data_cl_aad/pgdata:/var/lib/postgresql/data"
web:
image: citizenlabs/adopt-a-drain
build: .
#command: >
# sh -c "sleep 20 && bundle exec rails s -p 3000 -b '0.0.0.0'"
command: >
sh -c "
while ! nc -z db 5432;
do
echo 'sleep';
sleep 1;
done;
echo 'Port open!'
bundle update;
bundle update rake;
bundle exec rake db:create;
bundle exec rake db:schema:load;
bundle exec rake db:migrate;
bundle exec rake data:load_things;
echo 'DONE with Data...ready to launch app';
bundle exec rails s -p 3000 -b '0.0.0.0'
"
volumes:
- .:/myapp
ports:
- "3000:3000"
depends_on:
- db
# Run the tests
# docker-compose run web bundle exec rake test