version: "3.7"

services:
  postgres:
    image: astraonline/postgrespgvector:2024
    environment:
      - POSTGRES_PASSWORD=Mfcd62!!Mfcd62!!
      - TZ=America/Sao_Paulo
      - PG_MAX_CONNECTIONS=500
    networks:
      - network_public
    ports:
      - 5432:5432
    volumes:
      - postgres_data:/var/lib/postgresql/data
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - node.role == manager
         # - node.hostname == worker1
      resources:
        limits:
          cpus: "1"
          memory: 3072M

volumes:
  postgres_data:
    external: true
    name: postgres_data

networks:
  network_public:
    external: true
    name: network_public
