version: "3.9"

# Documentary parity only: on the build host there is no docker/podman and a
# PostgreSQL instance already listens on 127.0.0.1:55432 with the same
# user/database names, so DATABASE_URL works unchanged either way.
services:
  postgres:
    image: postgres:16
    container_name: smm_panel_db
    restart: unless-stopped
    environment:
      POSTGRES_USER: smm
      POSTGRES_DB: smm_panel
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    ports:
      - "55432:5432"
    volumes:
      - smm_pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U smm -d smm_panel"]
      interval: 10s
      timeout: 5s
      retries: 10

volumes:
  smm_pgdata:
