-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
71 lines (68 loc) · 2.29 KB
/
docker-compose.dev.yml
File metadata and controls
71 lines (68 loc) · 2.29 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
# 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:-5432}:5432"
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-vulcan_vue_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/data
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_vue_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
depends_on:
db:
condition: service_healthy
command: >
bash -c "rm -f tmp/pids/server.pid &&
bin/rails db:prepare && yarn build:watch &
bundle exec rails server -b 0.0.0.0 -p 3000"
volumes:
vulcan_dev_dbdata: