forked from awesome-release/rails_postgres_redis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
50 lines (46 loc) · 1 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
version: '3'
services:
api:
build: .
image: rails_postgres_redis:latest
command: bash -c "(rake db:exists && rake db:migrate || rake db:setup) && bundle exec rails s -b 0.0.0.0"
environment:
REDIS_URL: redis://redis:6379/0
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_HOST: db
ports:
- "3000:3000"
depends_on:
- db
- redis
sidekiq:
image: rails_postgres_redis:latest
command: bundle exec sidekiq
environment:
REDIS_URL: redis://redis:6379/0
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_HOST: db
depends_on:
- api
- redis
- db
db:
image: postgres:12-alpine
ports:
- "5432"
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
redis:
image: redis
ports:
- "6379"
volumes:
- redis:/data
volumes:
postgres-data: {}
redis: {}