services:
  application:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      # - composer-vendor:/var/www/html/vendor  # Uncomment if experiencing font-awesome issues. See docker/README.md.
      - .:/var/www/html/
    ports:
      - "8080:80"
    depends_on:
      - database
      - msgbroker
      - mailsink
  database:
    image: mariadb:10.11.3
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: waca
      MYSQL_DATABASE: waca
      MYSQL_USER: waca
      MYSQL_PASSWORD: waca
    volumes:
      - mysql-data:/var/lib/mysql
      - ./docker/database.sh:/docker-entrypoint-initdb.d/init.sh
      - ./sql:/wacadb
  msgbroker:
    image: rabbitmq:3.10.8-management-alpine
    ports:
      - "5672:5672" # Actual message broker port.
      - "15672:15672" # Management web interface port. Plain HTTP, username guest, password guest.
    volumes:
      - rabbitmq-data:/var/lib/rabbitmq
      - ./docker/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
      - ./docker/rabbitmq-definitions.json:/etc/rabbitmq/definitions.json
  mailsink:
    image: nicktriller/mail-sink
    ports:
      - "1025:1025" # SMTP target to receive (and sink) emails
      - "8081:8080" # HTTP web interface to view received emails

volumes:
  # composer-vendor:  # Uncomment if experiencing font-awesome issues. See docker/README.md.
  mysql-data:
  rabbitmq-data:
