-
Notifications
You must be signed in to change notification settings - Fork 10
/
docker-compose.yml
68 lines (60 loc) · 1.55 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
version: '3.2'
services:
database:
environment:
- POSTGRES_DB=books_test
image: postgres
console:
depends_on:
- migrated_database
build: ./backend
environment:
- HANAMI_ENV=test
- DATABASE_URL=postgres://postgres@twist_database_1/books_test
command: bash -c "sleep 5 && bundle exec hanami console"
migrated_database:
depends_on:
- database
build: ./backend
command: bash -c "sleep 5 && bundle exec hanami db migrate"
environment:
- HANAMI_ENV=test
backend:
build: ./backend
hostname: backend
environment:
- HANAMI_ENV=test
- DATABASE_URL=postgres://postgres@twist_database_1/books_test
- PORT=80
command: scripts/server
depends_on:
- database
frontend:
build: ./frontend
environment:
- API_HOST=http://backend:2300
ports:
- 80
depends_on:
- backend
tests:
depends_on:
- migrated_database
- frontend
build: ./backend
command: bash -c "sleep 5 && bundle exec rspec spec/features"
environment:
- DATABASE_URL=postgres://postgres@twist_database_1/books_test
- HEADLESS=1
- FRONTEND_APP_URL=http://frontend
- HANAMI_ENV=test
screenshots:
depends_on:
- migrated_database
- frontend
build: ./screenshots
command: google-chrome --headless --no-sandbox --disable-gpu --screenshot=/opt/app/static/screenshot.png --window-size=1280,1696 http://frontend
volumes:
- type: bind
source: ./static
target: /opt/app/static