version: "3.7"

networks:
  mother:
    external: true

services:
  pg-0:
    image: bitnami/postgresql:13.6.0
    environment:
      - POSTGRESQL_USERNAME=imeduser
      - POSTGRESQL_PASSWORD=kDn1kwHQlAPks9qhY/NC
      - POSTGRESQL_DATABASE=imeddb
      - POSTGRESQL_TIMEZONE=Asia/Tehran
    volumes:
      - /volume/pg:/bitnami/postgresql
    ports:
      - "5432:5432"
    networks:
      - mother
    deploy:
      resources:
        limits:
          cpus: "1"
          memory: 500M
      update_config:
        parallelism: 1
        delay: 10s
        order: stop-first
      restart_policy:
        condition: any
        delay: 5s
        max_attempts: 3
        window: 120s
