services:
  postgres:
    image: postgres:16
    container_name: qc_trace_postgres
    environment:
      POSTGRES_DB: qc_trace
      POSTGRES_USER: qc_trace
      POSTGRES_PASSWORD: qc_trace_dev
    ports:
      - "5432:5432"
    volumes:
      - qc_trace_pgdata:/var/lib/postgresql/data
      - ./qc_trace/db/schema.sql:/docker-entrypoint-initdb.d/001_schema.sql:ro
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U qc_trace -d qc_trace"]
      interval: 5s
      timeout: 5s
      retries: 5

volumes:
  qc_trace_pgdata:
