generated from espoo-dev/rails_boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
72 lines (68 loc) · 1.39 KB
/
docker-compose.yml
File metadata and controls
72 lines (68 loc) · 1.39 KB
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
version: "3"
x-app: &app
build:
context: .
args:
RUBY_VERSION: "3.2.2"
PG_MAJOR: "15"
NODE_MAJOR: "18"
environment: &env
NODE_ENV: ${NODE_ENV:-development}
tmpfs:
- /tmp
- /app/tmp/pids
x-backend: &backend
<<: *app
stdin_open: true
tty: true
environment: &backend_environment
<<: *env
volumes:
- .:/app
- backend_data:/usr/local/bundle
depends_on: &backend_depends_on
database:
condition: service_healthy
redis:
condition: service_healthy
services:
database:
hostname: database-app-container
image: postgres:15
environment:
- POSTGRES_PASSWORD=postgres
volumes:
- database-data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: pg_isready -U postgres -h 127.0.0.1
interval: 5s
web:
<<: *backend
hostname: web-app-container
ports:
- "3000:3000"
command: rails server -b 0.0.0.0 -p 3000
depends_on:
sidekiq:
condition: service_started
sidekiq:
<<: *backend
hostname: sidekiq-app-container
command: /app/bin/bundle exec sidekiq
redis:
image: docker.io/redis:latest
hostname: redis
command: redis-server
ports:
- "6379:6379"
healthcheck:
test: redis-cli ping
interval: 1s
timeout: 3s
retries: 30
volumes:
backend_data:
database-data:
driver: local