-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
79 lines (71 loc) · 2.39 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
79 lines (71 loc) · 2.39 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
services:
postgres:
image: kartoza/postgis:17-3.5
# Use kartoza/postgis for consistency with production
container_name: timetiles-postgres
environment:
# Standard postgres image variables (sourced from DB_* for consistency with prod)
POSTGRES_DB: ${DB_NAME:-timetiles}
POSTGRES_USER: ${DB_USER:-timetiles_user}
POSTGRES_PASSWORD: ${DB_PASSWORD:-timetiles_password}
# Kartoza image variables
POSTGRES_DBNAME: ${DB_NAME:-timetiles}
POSTGRES_PASS: ${DB_PASSWORD:-timetiles_password}
# Kartoza networking - allow connections from Docker network
ALLOW_IP_RANGE: "0.0.0.0/0"
# Disable SSL for local dev
FORCE_SSL: "false"
# PostgreSQL tuning via kartoza's EXTRA_CONF
# Tuned for M1 MacBook with 32GB RAM
# See: https://pgtune.leopard.in.ua/ for production tuning
EXTRA_CONF: |
# Connection limits
max_connections = 200
max_locks_per_transaction = 1024
# Memory - tuned for 32GB RAM dev machine
shared_buffers = 2GB
work_mem = 256MB
maintenance_work_mem = 1GB
effective_cache_size = 8GB
huge_pages = off
# Durability - DISABLED for dev/testing speed (35% faster)
# DO NOT use in production!
synchronous_commit = off
fsync = off
full_page_writes = off
# Query planner - NVMe SSD optimized
random_page_cost = 1.1
effective_io_concurrency = 200
seq_page_cost = 1.0
# Parallelism - M1 has 8 performance cores
max_parallel_workers_per_gather = 4
max_parallel_workers = 8
max_worker_processes = 8
parallel_tuple_cost = 0.01
parallel_setup_cost = 100
# WAL - faster writes for dev
wal_buffers = 64MB
checkpoint_completion_target = 0.9
min_wal_size = 1GB
max_wal_size = 4GB
# Misc
max_stack_depth = 7680kB
log_statement = none
default_statistics_target = 200
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./deployment/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U timetiles_user -d timetiles"]
interval: 10s
timeout: 5s
retries: 5
networks:
- timetiles-network
volumes:
postgres_data:
networks:
timetiles-network:
driver: bridge