-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
55 lines (52 loc) · 1.3 KB
/
docker-compose.yml
File metadata and controls
55 lines (52 loc) · 1.3 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
services:
postgres:
image: postgres:15-alpine
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: better_structure_sql_development
volumes:
- postgres_data:/var/lib/postgresql/data
- ./integration/db/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
networks:
- app-network
web:
build:
context: .
args:
USER_ID: ${USER_ID:-1000}
GROUP_ID: ${GROUP_ID:-1000}
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails server -b 0.0.0.0"
volumes:
- .:/app
- bundle_cache:/usr/local/bundle
ports:
- "3000:3000"
environment:
# Database connection (matching database.yml ENV variables)
DB_HOST: postgres
DB_USERNAME: postgres
DB_PASSWORD: postgres
DB_NAME: better_structure_sql_development
# Rails environment
RAILS_ENV: development
# Gem configuration
BETTER_STRUCTURE_SQL_ROOT: /app
depends_on:
postgres:
condition: service_healthy
networks:
- app-network
volumes:
postgres_data:
bundle_cache:
networks:
app-network:
driver: bridge