-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
120 lines (111 loc) · 2.51 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
118
119
120
version: "2.4"
x-app: &app
build:
context: .
dockerfile: Dockerfile
tmpfs:
- /tmp
stdin_open: true
tty: true
volumes:
- .:/usr/src/app
environment: &app_env
ACTION_CABLE_ADAPTER: any_cable
REDIS_URL: redis://redis:6379/0
REDIS_SIDEKIQ_URL: redis://redis:6379/1
CABLE_URL: ws://localhost:8080/cable
ANYCABLE_REDIS_URL: redis://redis:6379/2
ANYCABLE_RPC_HOST: anycable:50051
ANYCABLE_HOST: "0.0.0.0"
ANYCABLE_DEBUG: 1
services:
rails:
<<: *app
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
ports:
- 3000:3000
volumes:
- .:/usr/src/app
depends_on:
sidekiq:
condition: service_started
websocket:
condition: service_started
database:
condition: service_healthy
redis:
condition: service_healthy
database:
image: postgres:latest
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: root
POSTGRES_DB: app_development
volumes:
- ./.volumes/postgres/data:/var/lib/postgres/data
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
sidekiq:
<<: *app
command: bundle exec sidekiq -C config/sidekiq.yml
depends_on:
database:
condition: service_healthy
redis:
condition: service_healthy
environment:
REDIS_URL: redis://redis:6379/1
redis:
image: redis:6.2.6
ports:
- 6379:6379
volumes:
- ./.volumes/redis:/data
command: ["--appendonly yes"]
healthcheck:
test: redis-cli ping
interval: 10s
timeout: 5s
retries: 30
websocket:
image: anycable/anycable-go:latest
ports:
- 8080:8080
environment:
<<: *app_env
depends_on:
redis:
condition: service_healthy
anycable:
<<: *app
command: bundle exec anycable
ports:
- "50051"
depends_on:
websocket:
condition: service_started
redis:
condition: service_healthy
elasticsearch:
image: elasticsearch:7.16.1
ports:
- "9200:9200"
volumes:
- ./.volumes/elasticsearch/:/usr/share/elasticsearch/data
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "discovery.type=single-node"
kibana:
image: kibana:7.16.1
ports:
- "5601:5601"
depends_on:
- elasticsearch
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "discovery.type=single-node"