-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
117 lines (112 loc) · 2.63 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
networks:
- app_network
volumes:
- postgres:/var/lib/postgresql/data
ports:
- '5432:5432'
expose:
- '5432'
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
ports:
- '6379:6379'
networks:
- app_network
volumes:
- 'redis:/data'
sidekiq:
image: event-radar-api-dev
build:
context: .
entrypoint: ['./docker-entrypoint-development-sidekiq.sh']
command: 'sidekiq'
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
environment: &common_env
DATABASE_URL: postgres://postgres:postgres@db:5432
REDIS_URL: redis://redis:6379
RAILS_ENV: development
RUBYOPT: '-W:no-deprecated -W:no-experimental --yjit'
# depends_on: # uncomment this to debug sidekiq jobs
# - rails
develop:
watch:
- action: sync
path: .
target: /app
ignore:
# By default everything from Dockerignore will not be synced
- public/assets/
- action: sync+restart
path: ./config
target: /app/config
- action: sync+restart
path: ./db
target: /app/db
- action: rebuild
path: Gemfile
volumes:
- bundle_cache:/bundle
- /var/run/docker.sock:/var/run/docker.sock
networks:
- app_network
rails:
image: event-radar-api-dev
build:
context: .
entrypoint: ['./docker-entrypoint-development-rails.sh']
command: 'rails s -b 0.0.0.0 -p 3000'
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
sidekiq:
condition: service_started
ports:
- '3000:3000'
environment:
<<: *common_env
develop:
watch:
- action: sync
path: .
target: /app
ignore:
# By default everything from Dockerignore will not be synced
- public/assets/
- action: sync+restart
path: ./config
target: /app/config
- action: sync+restart
path: ./db
target: /app/db
- action: rebuild
path: Gemfile
volumes:
- bundle_cache:/bundle
- /var/run/docker.sock:/var/run/docker.sock
networks:
- app_network
stdin_open: true
tty: true
networks:
app_network:
volumes:
redis:
postgres:
bundle_cache: