version: '3.8'

services:
  mongodb:
    image: mongo:7.0
    container_name: mongodb
    restart: unless-stopped
    ports:
      - "127.0.0.1:27017:27017"     # solo localhost, NON esposto a Internet
    environment:
      MONGO_INITDB_ROOT_USERNAME: fastcheck_admin
      MONGO_INITDB_ROOT_PASSWORD: "MettiQuiUnaPasswordSeria123!"
      # Nessun MONGO_INITDB_DATABASE -> parte vuoto
    volumes:
      - mongodb_data:/data/db
      - mongodb_config:/data/configdb
    networks:
      - duxiter-network

  rabbitmq:
    image: rabbitmq:3.12-management
    container_name: rabbitmq
    restart: unless-stopped
    ports:
      - "5672:5672"     # AMQP
      - "15672:15672"   # Management UI
    environment:
      RABBITMQ_DEFAULT_USER: admin
      RABBITMQ_DEFAULT_PASS: password123
    volumes:
      - rabbitmq_data:/var/lib/rabbitmq
    networks:
      - duxiter-network

volumes:
  mongodb_data:
    driver: local
  mongodb_config:
    driver: local
  rabbitmq_data:
    driver: local

networks:
  duxiter-network:
    driver: bridge
