-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
93 lines (93 loc) · 2.2 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
version: '3.7'
services:
nginx:
image: nginx
container_name: nginx
ports:
- '80:80'
volumes:
- ./nginx:/etc/nginx/conf.d/
depends_on:
- webapp
- dev-webapp
- api
- dev
- test
db:
image: postgres
container_name: db
environment:
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
volumes:
- ./tmp/database:/var/lib/postgresql/data
ports:
- '8000:5432'
webapp:
container_name: webapp
image: applada_webapp
build:
context: './webapp'
command: npm start
expose:
- 3000
dev-webapp:
container_name: dev-webapp
image: applada_webapp
build:
context: './webapp'
command: npm start
volumes:
- ./webapp:/webapp
expose:
- 3000
depends_on:
- webapp
api:
container_name: api
image: applada
build:
context: './api'
command: bash -c "rm -f tmp/pids/server.pid && (rails db:migrate || rails db:setup && rails db:migrate) && rails server --binding=0.0.0.0 --port=80 -e production"
environment:
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
RAILS_ENV: production
volumes:
- ./tmp/api:/tmp
expose:
- 80
depends_on:
- db
dev:
container_name: dev
image: applada
build:
context: './api'
command: bash -c "rm -f tmp/pids/server.pid && (rails db:migrate RAILS_ENV=development || rails db:setup && rails db:migrate RAILS_ENV=development) && rails server --binding=0.0.0.0 --port=80 -e development"
environment:
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
RAILS_ENV: development
volumes:
- ./api:/api
- ./tmp/dev:/api/tmp
expose:
- 80
depends_on:
- db
- api
test:
container_name: test
image: applada
build:
context: './api'
command: bash -c "rm -f tmp/pids/server.pid && (rails db:migrate RAILS_ENV=test || rails db:setup && rails db:migrate RAILS_ENV=test) && rails server --binding=0.0.0.0 --port=80 -e test"
environment:
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
RAILS_ENV: test
volumes:
- ./api:/api
- ./tmp/test:/api/tmp
expose:
- 80
depends_on:
- db
- api