-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathdocker-compose.yml
64 lines (64 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
version: '3'
services:
setup:
build: .
depends_on:
- postgres
environment:
- REDIS_PORT=6379
- DATABASE_URL=postgres
- DATABASE_PORT=5432
- DATABASE_NAME=rails-kube-demo_production
- DATABASE_USER=postgres
- DATABASE_PASSWORD=mysecurepass
- RAILS_ENV=production
command: "bin/rails db:migrate"
postgres:
image: postgres:9.6-alpine
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=mysecurepass
- POSTGRES_DB=rails-kube-demo_production
- PGDATA=/var/lib/postgresql/data
db_data:
image: postgres:9.6-alpine
volumes:
- /var/lib/postgresql/data
command: /bin/true
sidekiq:
build: .
command: "bin/bundle exec sidekiq -C config/sidekiq.yml"
environment:
- REDIS_URL=redis
- REDIS_PORT=6379
- DATABASE_URL=postgres
- DATABASE_PORT=5432
- DATABASE_NAME=rails-kube-demo_production
- DATABASE_USER=postgres
- DATABASE_PASSWORD=mysecurepass
depends_on:
- redis
redis:
image: redis:5.0-alpine
ports:
- "6379:6379"
web:
build: .
command: "bin/bundle exec rails s -p 3000 -b 0.0.0.0"
depends_on:
- redis
- postgres
- setup
environment:
- RAILS_ENV=development
- REDIS_URL=redis
- REDIS_PORT=6379
- DATABASE_URL=postgres
- DATABASE_PORT=5432
- DATABASE_NAME=rails-kube-demo_production
- DATABASE_USER=postgres
- DATABASE_PASSWORD=mysecurepass
volumes:
- .:/myapp
ports:
- "3000:3000"