version: '3.1'

services:
  service-email:
    container_name: service-email-${TAG}
    build: .
    image: registry.alpha.grandlyon.com/refonte-data/service-email:${TAG}
    ports:
      - ${DEV_SERVICE_EMAIL_PORT}:3000
    environment:
      - NODE_ENV=${NODE_ENV}
      - PLATEFORM_DATA_EMAIL=${DEV_PLATEFORM_DATA_EMAIL}
      - RABBITMQ_USER=${DEV_RABBITMQ_USER}
      - RABBITMQ_PASSWORD=${DEV_RABBITMQ_PASSWORD}
      - GROUP_HEADER=x-consumer-groups
      - EMAIL_WRITER_GROUP_NAME=email-writer
    restart: unless-stopped
  rabbitmq:
    image: 'rabbitmq:3-management-alpine'
    container_name: rabbitmq-${TAG}
    ports:
      - ${DEV_RABBITMQ_STANDARD_PORT}:5672 # standard port for communication
      - ${DEV_RABBITMQ_INTERFACE_PORT}:15672 # graphique interface
    environment:
      - RABBITMQ_DEFAULT_USER=${DEV_RABBITMQ_USER}
      - RABBITMQ_DEFAULT_PASS=${DEV_RABBITMQ_PASSWORD}
    volumes:
      - rabbitmqPersistence:/var/lib/rabbitmq
    restart: unless-stopped  

volumes:
  rabbitmqPersistence: 