-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
96 lines (90 loc) · 2.17 KB
/
docker-compose.yml
File metadata and controls
96 lines (90 loc) · 2.17 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
services:
db:
image: postgres:18-alpine
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: streamsource
POSTGRES_PASSWORD: streamsource_password
POSTGRES_DB: streamsource_development
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U streamsource -d streamsource_development"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:8-alpine
ports:
- "6380:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
web:
build: .
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails server -b 0.0.0.0"
volumes:
- .:/rails:cached
- bundle_cache:/usr/local/bundle
ports:
- "3001:3000"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
RAILS_ENV: development
DATABASE_URL: postgres://streamsource:streamsource_password@db:5432/streamsource_development
REDIS_URL: redis://redis:6379/0
BUNDLE_WITHOUT: ""
stdin_open: true
tty: true
js:
build: .
command: yarn build --watch=forever
volumes:
- .:/rails:cached
working_dir: /rails
stdin_open: true
tty: true
css:
build: .
command: yarn build:css --watch
volumes:
- .:/rails:cached
working_dir: /rails
stdin_open: true
tty: true
test:
build:
context: .
target: test
volumes:
- .:/rails
- bundle_cache:/usr/local/bundle
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
RAILS_ENV: test
DATABASE_URL: postgres://streamsource:streamsource_password@db:5432/streamsource_test
REDIS_URL: redis://redis:6379/1
RAILS_LOG_TO_STDOUT: "true"
profiles:
- test
command: >
sh -c "
bundle exec rails db:create 2>/dev/null || true &&
bundle exec rails db:schema:load 2>/dev/null || true &&
bundle exec rails db:migrate &&
sleep infinity
"
volumes:
postgres_data:
bundle_cache: