version: '3.9'

services:
  postgres:
    image: postgres:15-alpine
    env_file:
      - .env
    volumes:
      - postgres_data:/var/lib/postgresql/data
    networks:
      - caddy-public
    deploy:
      placement:
        constraints:
          - "node.labels.role==db"
      replicas: 1
      labels:
        - "traefik.enable=false"

volumes:
  postgres_data:
    driver: local

# Removed secrets section since we're using direct environment variables

networks:
  caddy-public:
    external: true
