-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
53 lines (48 loc) · 1.17 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
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
environment:
RAILS_ENV: ${RAILS_ENV}
RAILS_MASTER_KEY: ${RAILS_MASTER_KEY}
DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
REDIS_URL: redis://redis:6379/1
depends_on:
- db
- redis
ports:
- "3000:3000"
volumes:
- .:/rails
command: [ "./bin/rails", "server", "-b", "0.0.0.0" ]
db:
image: postgres:15
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- pgdata:/var/lib/postgresql/data
redis:
image: redis:7
command: [ "redis-server", "--appendonly", "yes" ]
volumes:
- redisdata:/data
sidekiq:
build:
context: .
dockerfile: Dockerfile
environment:
RAILS_ENV: ${RAILS_ENV}
RAILS_MASTER_KEY: ${RAILS_MASTER_KEY}
DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
REDIS_URL: redis://redis:6379/1
depends_on:
- db
- redis
command: [ "bundle", "exec", "sidekiq" ]
volumes:
pgdata:
redisdata: