-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
98 lines (90 loc) · 1.85 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
x-rails: &rails
build: &build
context: .
dockerfile: Dockerfile
environment: &env
DATABASE_URL: postgres://postgres:postgres@postgres:5432
REDIS_URL: redis://redis:6379/
tmpfs:
- /tmp
depends_on: &deps
postgres:
condition: service_healthy
redis:
condition: service_healthy
x-dev: &dev
volumes:
- .:/usr/src:cached
- bundle:/usr/src/.bundle
- rails_cache:/usr/src/tmp/cache
services:
rails-prod:
<<: *rails
environment:
<<: *env
RAILS_SERVE_STATIC_FILES: "true"
RAILS_LOG_TO_STDOUT: "true"
ports:
- "5000:3000"
profiles:
- prod
rails-dev:
<<: *rails
<<: *dev
environment:
<<: *env
RAILS_ENV: development
ports:
- "3000:3000"
depends_on:
<<: *deps
vite-dev:
condition: service_healthy
resque:
<<: *rails
<<: *dev
environment:
<<: *env
RAILS_ENV: development
QUEUE: "*"
command: bin/rake resque:work
vite-dev:
build:
context: ./frontend
target: dev
volumes:
- ./frontend:/opt/friday/src
- ./frontend/package.json:/opt/friday/package.json
- ./frontend/package-lock.json:/opt/friday/package-lock.json
ports:
- "4000:4000"
healthcheck:
test: ["CMD", "wget", "-O/dev/null", "http://localhost:4000/@vite/client"]
interval: 5s
postgres:
image: postgres:13
volumes:
- postgres:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: postgres
ports:
- 5432
healthcheck:
test: pg_isready -U postgres -h 127.0.0.1
interval: 5s
redis:
image: redis:6-alpine
volumes:
- redis:/data
ports:
- 6379
healthcheck:
test: redis-cli ping
interval: 1s
timeout: 3s
retries: 30
volumes:
bundle:
postgres:
rails_cache:
redis: