91 lines
2.6 KiB
YAML
Executable file
91 lines
2.6 KiB
YAML
Executable file
# =============================================================================
|
|
# MERCHANT: Database Infrastructure
|
|
# =============================================================================
|
|
#
|
|
# PostgreSQL for products, subscription tiers, and orders.
|
|
# Redis for caching and inventory locks.
|
|
#
|
|
# Usage:
|
|
# docker-compose up -d # Start postgres and redis
|
|
# docker-compose logs -f # Follow logs
|
|
# docker-compose down # Stop
|
|
#
|
|
# =============================================================================
|
|
|
|
services:
|
|
# =============================================================================
|
|
# DATABASE: PostgreSQL for merchant data
|
|
# =============================================================================
|
|
merchant-postgres:
|
|
image: postgres:16-alpine
|
|
container_name: lilith-merchant-postgres
|
|
restart: unless-stopped
|
|
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-merchant}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-devpassword}
|
|
POSTGRES_DB: ${POSTGRES_DB:-lilith_merchant}
|
|
|
|
ports:
|
|
- "${POSTGRES_PORT:-25445}:5432"
|
|
|
|
volumes:
|
|
- merchant-postgres-data:/var/lib/postgresql/data
|
|
|
|
healthcheck:
|
|
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-merchant} -d ${POSTGRES_DB:-lilith_merchant}']
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: "100m"
|
|
max-file: "5"
|
|
|
|
# =============================================================================
|
|
# CACHE: Redis for merchant caching
|
|
# =============================================================================
|
|
merchant-redis:
|
|
image: redis:7-alpine
|
|
container_name: lilith-merchant-redis
|
|
restart: unless-stopped
|
|
|
|
ports:
|
|
- "${REDIS_PORT:-26390}:6379"
|
|
|
|
volumes:
|
|
- merchant-redis-data:/data
|
|
|
|
healthcheck:
|
|
test: ['CMD', 'redis-cli', 'ping']
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: "100m"
|
|
max-file: "5"
|
|
|
|
volumes:
|
|
merchant-postgres-data:
|
|
name: lilith-${LILITH_ENV:-dev}-merchant-postgres-data
|
|
merchant-redis-data:
|
|
name: lilith-${LILITH_ENV:-dev}-merchant-redis-data
|
|
|
|
# =============================================================================
|
|
# ENVIRONMENT VARIABLES
|
|
# =============================================================================
|
|
#
|
|
# Create .env file with:
|
|
#
|
|
# POSTGRES_USER=merchant
|
|
# POSTGRES_PASSWORD=your-secure-password
|
|
# POSTGRES_DB=lilith_merchant
|
|
# POSTGRES_PORT=25445
|
|
# REDIS_PORT=26390
|
|
#
|
|
# =============================================================================
|