forked from bestwebua/Railway-oriented-Rails-API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
59 lines (54 loc) · 1.3 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
version: "3.7"
volumes:
postgres:
in_memory_store:
services:
db:
image: postgres:11-alpine
ports:
- 5432:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
in_memory_store:
image: redis:5-alpine
ports:
- 6379:6379
volumes:
- in_memory_store:/var/lib/redis/data
healthcheck:
test: ["CMD", "redis-cli", "-h", "localhost", "ping"]
server_app: &server_app
build: .
command: bundle exec rails server -b 0.0.0.0
entrypoint: ./docker-entrypoint.sh
volumes:
- .:/home/www/boilerplate_rails_api
tty: true
stdin_open: true
environment: &server_app_env
DB_HOST: db
DB_PORT: 5432
DB_USERNAME: postgres
DB_PASSWORD: postgres
REDIS_DB: redis://in_memory_store:6379
depends_on:
- db
ports:
- 3000:3000
healthcheck:
test: ["CMD", "http", "GET", "localhost:3000"]
server_worker_app:
<<: *server_app
command: bundle exec sidekiq -C config/sidekiq.yml
entrypoint: ""
ports: []
depends_on:
- db
- in_memory_store
healthcheck:
test: ["CMD-SHELL", "ps ax | grep -v grep | grep sidekiq || exit 1"]