services:
  alb:
    image: nginx:1.27-alpine
    container_name: apusic-poc-alb
    ports:
      - "18080:80"
    volumes:
      - ./alb/default.conf:/etc/nginx/conf.d/default.conf:ro
      - ./app:/var/www/html:ro
    depends_on:
      - php-fpm
    networks:
      - apusic-poc

  php-fpm:
    image: php:7.4-fpm-alpine
    container_name: apusic-poc-php-fpm
    volumes:
      - ./app:/var/www/html:ro
    environment:
      AMDC_HOST: amdc
      AMDC_PORT: "6359"
      ADMQ_HOST: admq
      ADMQ_PORT: "1883"
    networks:
      - apusic-poc

  amdc:
    image: redis:7-alpine
    container_name: apusic-poc-amdc
    command: ["redis-server", "--port", "6359", "--appendonly", "yes"]
    ports:
      - "16359:6359"
    volumes:
      - amdc-data:/data
    networks:
      - apusic-poc

  admq:
    image: eclipse-mosquitto:2
    container_name: apusic-poc-admq
    ports:
      - "1883:1883"
    volumes:
      - ./admq/mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
      - admq-data:/mosquitto/data
      - admq-log:/mosquitto/log
    networks:
      - apusic-poc

networks:
  apusic-poc:
    name: apusic-poc

volumes:
  amdc-data:
  admq-data:
  admq-log:
