Repository navigation
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
81 lines (78 loc) · 2.8 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
81 lines (78 loc) · 2.8 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
# Development Docker Compose — database + optional containerized dev server.
# Used by bin/setup to start PostgreSQL for native Rails development.
#
# Usage (via setup script — recommended):
# bin/setup
#
# Usage (database only — manual):
# docker compose -f docker-compose.dev.yml up db -d
# bin/rails db:prepare
# foreman start -f Procfile.dev
#
# Usage (full containerized dev):
# docker compose -f docker-compose.dev.yml up -d
#
# For deployment: use docker-compose.yml (the default).
name: vulcan
services:
db:
image: postgres:18-alpine
restart: unless-stopped
ports:
- "${POSTGRES_PORT:-5435}:5432"
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-vulcan_development}
# Trust auth for local dev. Corporate VPNs (GlobalProtect, etc.) interfere
# with scram-sha-256 challenge-response handshakes through container runtime
# port forwarding proxies (OrbStack, Docker Desktop). This is a known issue
# with no upstream fix: https://github.com/orbstack/orbstack/issues/2267
# Mastodon and GitLab CI use the same approach for dev/CI environments.
# Production uses docker-compose.yml which does NOT set this.
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- vulcan_dev_dbdata:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
web:
build:
context: .
dockerfile: Dockerfile
target: development
environment:
DATABASE_HOST: db
DATABASE_PORT: "5432"
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-vulcan_development}
RAILS_ENV: development
VULCAN_FIRST_USER_ADMIN: "true"
VULCAN_ENABLE_LOCAL_LOGIN: "true"
VULCAN_ENABLE_USER_REGISTRATION: "true"
ports:
- "${VULCAN_PORT:-3000}:3000"
volumes:
- .:/rails
- /rails/node_modules
depends_on:
db:
condition: service_healthy
# Setup steps run sequentially in the foreground; `bash -e` aborts the
# container if any of them fail, so a failed db:prepare surfaces as a dead
# container instead of a booted server that raises PendingMigrationError on
# every request. Only the asset watcher is backgrounded — `;` separators
# scope the trailing `&` to `yarn build:watch` alone. `exec` hands PID 1 to
# Puma so docker stop/Ctrl-C signals reach it directly.
command: >
bash -ec "rm -f tmp/pids/server.pid;
bin/rails db:prepare;
yarn install --frozen-lockfile;
yarn build;
yarn build:watch &
exec bundle exec rails server -b 0.0.0.0 -p 3000"
volumes:
vulcan_dev_dbdata: