-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
90 lines (90 loc) · 2.12 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
version: "3.7"
services:
api:
build:
context: ./api
dockerfile: Dockerfile
image: tracking-test-automation-api
working_dir: /api
tty: true
stdin_open: true
command: >
/bin/sh -c "
bundle install
rerun -- rackup --host 0.0.0.0 --port 3000 config.ru
"
volumes:
- ./api:/api:delegated
ports:
- 3000:3000
networks:
trackingprototype:
aliases:
- api.localhost
qa:
build:
context: ./qa
dockerfile: Dockerfile
image: tracking-test-automation-qa
working_dir: /qa
tty: true
stdin_open: true
command: >
/bin/sh -c "
while ! nc -zv api 3000;
do
echo 'API not ready' && sleep 5
done
while ! nc -zv web 8000;
do
echo 'Web not ready' && sleep 5
done
BrowserStackLocal --key ${BROWSERSTACK_ACCESS_KEY:-bs_access_key} --local-proxy-host ${LOCAL_PROXY_HOST:-127.0.0.1} --local-proxy-port ${LOCAL_PROXY_PORT:-8081} --local-proxy-pass --force-proxy --force-local --enable-logging-for-api --verbose 3 --daemon start
rspec -f d
"
volumes:
- ./qa:/qa:delegated
ports:
- 8080-8581:8080-8581
networks:
trackingprototype:
aliases:
- qa.localhost
environment:
BROWSERSTACK_USERNAME: ${BROWSERSTACK_USERNAME:-bs_username}
BROWSERSTACK_ACCESS_KEY: ${BROWSERSTACK_ACCESS_KEY:-bs_access_key}
depends_on:
- api
- web
web:
build:
context: ./web
dockerfile: Dockerfile
image: tracking-test-automation-web
working_dir: /web
tty: true
stdin_open: true
command: >
/bin/sh -c "
while ! nc -zv api 3000;
do
echo 'API not ready' && sleep 5
done
if [ ! -d /web/node_modules ]; then
yarn
fi
yarn run serve --host 0.0.0.0 --port 8000
"
volumes:
- ./web:/web:delegated
ports:
- 8000:8000
networks:
trackingprototype:
aliases:
- web.localhost
depends_on:
- api
networks:
trackingprototype:
driver: "bridge"