2025-10-25 13:52:01 +02:00
|
|
|
services:
|
|
|
|
|
# PostgreSQL - Central Database
|
|
|
|
|
postgres:
|
|
|
|
|
image: ${CORE_POSTGRES_IMAGE:-postgres:16-alpine}
|
|
|
|
|
container_name: ${CORE_COMPOSE_PROJECT_NAME}_postgres
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
environment:
|
|
|
|
|
TZ: ${TIMEZONE:-Europe/Amsterdam}
|
|
|
|
|
POSTGRES_USER: ${DB_USER}
|
|
|
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
|
|
|
# Performance tuning
|
|
|
|
|
POSTGRES_MAX_CONNECTIONS: ${CORE_POSTGRES_MAX_CONNECTIONS:-100}
|
|
|
|
|
POSTGRES_SHARED_BUFFERS: ${CORE_POSTGRES_SHARED_BUFFERS:-256MB}
|
2025-10-26 11:13:35 +01:00
|
|
|
ports:
|
|
|
|
|
- 5432:5432
|
2025-10-25 13:52:01 +02:00
|
|
|
volumes:
|
|
|
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
|
- ./postgres/init:/docker-entrypoint-initdb.d:ro
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
|
|
|
|
|
interval: 30s
|
|
|
|
|
timeout: 10s
|
|
|
|
|
retries: 3
|
|
|
|
|
start_period: 40s
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
- compose_network
|
|
|
|
|
|
|
|
|
|
redis:
|
|
|
|
|
image: ${CORE_REDIS_IMAGE:-redis:7-alpine}
|
|
|
|
|
container_name: ${CORE_COMPOSE_PROJECT_NAME}_redis
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
environment:
|
|
|
|
|
TZ: ${TIMEZONE:-Europe/Amsterdam}
|
|
|
|
|
volumes:
|
|
|
|
|
- redis_data:/data
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
|
|
|
|
|
interval: 30s
|
|
|
|
|
timeout: 10s
|
|
|
|
|
retries: 3
|
|
|
|
|
start_period: 20s
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
- compose_network
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
postgres_data:
|
|
|
|
|
name: ${CORE_COMPOSE_PROJECT_NAME}_postgres_data
|
|
|
|
|
redis_data:
|
|
|
|
|
name: ${CORE_COMPOSE_PROJECT_NAME}_redis_data
|