services:

  app_proxy:
    environment:
      APP_HOST: mosquitto_web_1
      APP_PORT: 80

  broker:
    image: eclipse-mosquitto:2.1.2-alpine@sha256:9cfdd46ad59f3e3e5f592f6baf57ab23e1ad00605509d0f5c1e9b179c5314d87
    restart: on-failure
    ports:
      - '1883:1883'
    volumes:
      - ${APP_DATA_DIR}/data/config:/mosquitto/config:rw
      - ${APP_DATA_DIR}/data/mosquitto:/mosquitto/data:rw
      - ${APP_DATA_DIR}/data/log:/mosquitto/log:rw
    user: "1000:1000"

  web:
    image: nginx:1.27@sha256:124b44bfc9ccd1f3cedf4b592d4d1e8bddb78b51ec2ed5056c52d3692baebc19
    restart: on-failure
    depends_on:
      - broker
    volumes:
      - ${APP_DATA_DIR}/data/www:/usr/share/nginx/html:ro
      - ${APP_DATA_DIR}/data/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
