/
docker-compose.yml
85 lines (74 loc) · 1.86 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
version: '3'
services:
################
# Database #
################
mongo: #database
image: mongo:3.6.0
ports:
- "27018:27017"
volumes:
- ./data/db:/data/db
################
# Development #
################
api: # rails json api
build: ./api
image: hackerhouse_api:latest
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
volumes:
- ./api/:/usr/src/app/
depends_on:
- mongo
env_file:
- ./api/.env
ports: ['3000:3000']
stdin_open: true
tty: true
app: # react app
build: ./client
image: hackerhouse_app:latest
command: npm start
volumes:
- ./client:/app
- /app/node_modules
ports: ['3001:3001']
################
# Test #
################
test: # execute rails tests
image: hackerhouse_api:latest
command: bundle exec rspec spec spec/features
environment:
- SELENIUM_REMOTE_HOST=selenium
volumes:
- ./api/:/usr/src/app/
depends_on:
- selenium
- mongo
- test_app
- test_api
test_api: # rails json api
image: hackerhouse_api:latest
command: bash -c "rm -f tmp/pids/test_server.pid && RAILS_ENV=test bundle exec rails s -p 3002 -b '0.0.0.0' -P tmp/pids/test_server.pid"
ports: ['3002:3002']
volumes:
- ./api/:/usr/src/app/
depends_on:
- mongo
test_app: # react app
environment:
- REACT_APP_LINKEDIN_REDIRECT_URI=http://test_app:3001/sessions/linkedin
- REACT_APP_API=http://test_api:3002
image: hackerhouse_app:latest
command: npm start
volumes:
- ./client:/app
- /app/node_modules
ports: ['3001']
selenium: # firefox
image: selenium/standalone-firefox-debug:latest
ports: ['4444:4444', '5900:5900']
environment:
- SCREEN_WIDTH=1440
- SCREEN_HEIGHT=900