101 lines
2.9 KiB
YAML
101 lines
2.9 KiB
YAML
services:
|
|
# Write-heavy ETL / app data (cdata). Keeps the bigger buffers and WAL headroom.
|
|
db:
|
|
container_name: PostgreSQL
|
|
#image: postgres:17
|
|
image: pgvector/pgvector:pg17
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "100m"
|
|
max-file: "3"
|
|
privileged: true
|
|
command: >
|
|
-c max_connections=200
|
|
-c shared_buffers=4GB
|
|
-c effective_cache_size=12GB
|
|
-c work_mem=64MB
|
|
-c maintenance_work_mem=512MB
|
|
-c wal_buffers=16MB
|
|
-c checkpoint_completion_target=0.9
|
|
-c max_wal_size=8GB
|
|
-c min_wal_size=2GB
|
|
-c checkpoint_timeout=15min
|
|
-c random_page_cost=1.1
|
|
-c effective_io_concurrency=200
|
|
-c log_min_duration_statement=1000
|
|
-c idle_in_transaction_session_timeout=120000
|
|
-c tcp_keepalives_idle=60
|
|
-c tcp_keepalives_interval=10
|
|
-c tcp_keepalives_count=5
|
|
-c log_connections=off
|
|
-c log_disconnections=off
|
|
-c log_checkpoints=on
|
|
-c log_lock_waits=on
|
|
-c log_autovacuum_min_duration=-1
|
|
user: "0:0"
|
|
healthcheck:
|
|
test: ["CMD", "pg_isready", "-q", "-d", "cdata", "-U", "ZeroZero"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
environment:
|
|
POSTGRES_USER: ZeroZero
|
|
POSTGRES_PASSWORD: h8blGfJ22OEjN3
|
|
POSTGRES_DB: cdata
|
|
POSTGRES_LISTEN_ADDRESSES: '*'
|
|
volumes:
|
|
- /home/docker/postgres:/var/lib/postgresql/data:rw
|
|
ports:
|
|
- 2665:5432
|
|
restart: always
|
|
|
|
# n8n's own database (workflows, credentials, failed-run records). Small footprint,
|
|
# but a long idle-in-transaction timeout so a briefly blocked worker isn't
|
|
# killed mid-save.
|
|
db-n8nApp:
|
|
container_name: PostgreSQL-n8nApp
|
|
#image: postgres:17
|
|
image: pgvector/pgvector:pg17
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "100m"
|
|
max-file: "3"
|
|
privileged: true
|
|
command: >
|
|
-c max_connections=100
|
|
-c shared_buffers=1GB
|
|
-c effective_cache_size=4GB
|
|
-c work_mem=16MB
|
|
-c maintenance_work_mem=256MB
|
|
-c wal_buffers=16MB
|
|
-c checkpoint_completion_target=0.9
|
|
-c random_page_cost=1.1
|
|
-c effective_io_concurrency=200
|
|
-c log_min_duration_statement=1000
|
|
-c idle_in_transaction_session_timeout=300000
|
|
-c tcp_keepalives_idle=60
|
|
-c tcp_keepalives_interval=10
|
|
-c tcp_keepalives_count=5
|
|
-c log_connections=off
|
|
-c log_disconnections=off
|
|
-c log_checkpoints=on
|
|
-c log_lock_waits=on
|
|
-c log_autovacuum_min_duration=-1
|
|
user: "0:0"
|
|
healthcheck:
|
|
test: ["CMD", "pg_isready", "-q", "-d", "n8n", "-U", "ZeroZero"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
environment:
|
|
POSTGRES_USER: ZeroZero
|
|
POSTGRES_PASSWORD: h8blGfJ22OEjN3
|
|
POSTGRES_DB: n8n
|
|
POSTGRES_LISTEN_ADDRESSES: '*'
|
|
volumes:
|
|
- /home/docker/postgres-n8nApp:/var/lib/postgresql/data:rw
|
|
ports:
|
|
- 2663:5432
|
|
restart: always |