services:
  postgres:
    container_name: postgres
    image: postgres:17.5-alpine3.22
    user: postgres
    ports:
      - 11111:5432
    environment:
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_DB=postgres
    volumes:
      - /opt/postgres/entrypoint.sh:/entrypoint.sh
      - /opt/postgres/postgresql.conf:/etc/postgresql/postgresql.conf
      - /opt/postgres/data:/var/lib/postgresql/data
      - /opt/postgres/cert.pem:/cert.pem
      - /opt/postgres/key.pem:/key.pem
    entrypoint: ["/bin/bash", "/entrypoint.sh"]

    command:
      - postgres
      - -c
      - config_file=/etc/postgresql/postgresql.conf
