Advertisement

← kuato

postgres/docker-compose.yml

579 bytes Download file
version: '3.8'

services:
  postgres:
    image: postgres:16-alpine
    container_name: claude-sessions-db
    environment:
      POSTGRES_USER: claude
      POSTGRES_PASSWORD: sessions
      POSTGRES_DB: claude_sessions
    ports:
      - "5433:5432"  # Different port to avoid conflicts
    volumes:
      - postgres_data:/var/lib/postgresql/data
      - ./schema.sql:/docker-entrypoint-initdb.d/01-schema.sql
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U claude -d claude_sessions"]
      interval: 5s
      timeout: 5s
      retries: 5

volumes:
  postgres_data: