-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
66 lines (63 loc) · 1.86 KB
/
Copy pathdocker-compose.yml
File metadata and controls
66 lines (63 loc) · 1.86 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
services:
db:
image: postgres:16.13
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
web:
build: .
# wkhtmltopdf-binary ships a 32-bit x86 binary; arm64 hosts can't run i386
# via multiarch (only amd64+i386 is a valid pairing), so force amd64 here.
platform: linux/amd64
command: bundle exec rails server -b 0.0.0.0
volumes:
- .:/app
ports:
- "3000:3000"
environment:
RAILS_ENV: development
DATABASE_HOST: db
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
depends_on:
db:
condition: service_healthy
stdin_open: true
tty: true
web_next:
# Reuse the image built for `web` (compose tags it <project>-web, i.e.
# audit-web) instead of building a second image. Only BUNDLE_GEMFILE
# differs, so a separate build is unnecessary. (Not using `extends` here:
# it merges array fields like `ports` instead of overriding them, which
# would leak web's 3000:3000 mapping into this service too.)
image: audit-web
platform: linux/amd64
# Distinct pidfile: web and web_next share the same bind-mounted /app, so
# they'd otherwise race on tmp/pids/server.pid and refuse to boot together.
command: bundle exec rails server -b 0.0.0.0 --pid tmp/pids/server_next.pid
volumes:
- .:/app
ports:
- "3001:3000"
environment:
RAILS_ENV: development
DATABASE_HOST: db
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
BUNDLE_GEMFILE: Gemfile.next
depends_on:
db:
condition: service_healthy
web:
condition: service_started
stdin_open: true
tty: true
volumes:
db_data: