---
# Managed by Ansible – signage_server role
# Do not edit manually on the server.

services:
  backend:
    image: git.az-it.net/az/morz-infoboard/backend:latest
    restart: unless-stopped
    ports:
      - "8080:8080"
    environment:
      MORZ_INFOBOARD_HTTP_ADDR: "${MORZ_HTTP_ADDR}"
      MORZ_INFOBOARD_DATABASE_URL: "${MORZ_DATABASE_URL}"
      MORZ_INFOBOARD_UPLOAD_DIR: /app/uploads
      MORZ_INFOBOARD_STATUS_STORE_PATH: /app/data/status
      MORZ_INFOBOARD_MQTT_BROKER: "${MORZ_MQTT_BROKER}"
      MORZ_INFOBOARD_MQTT_USERNAME: "${MORZ_MQTT_USERNAME}"
      MORZ_INFOBOARD_MQTT_PASSWORD: "${MORZ_MQTT_PASSWORD}"
      MORZ_INFOBOARD_ADMIN_PASSWORD: "${MORZ_ADMIN_PASSWORD}"
      MORZ_INFOBOARD_DEFAULT_TENANT: "${MORZ_DEFAULT_TENANT}"
      MORZ_INFOBOARD_DEV_MODE: "${MORZ_DEV_MODE}"
    volumes:
      - ./uploads:/app/uploads
      - ./data:/app/data
    depends_on:
      db:
        condition: service_healthy

  db:
    image: postgres:17-alpine
    restart: unless-stopped
    environment:
      POSTGRES_USER: morz_infoboard
      POSTGRES_PASSWORD: "${MORZ_DB_PASSWORD}"
      POSTGRES_DB: morz_infoboard
    volumes:
      - db_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U morz_infoboard"]
      interval: 10s
      timeout: 5s
      retries: 5

  mqtt:
    image: eclipse-mosquitto:2
    restart: unless-stopped
    ports:
      - "1883:1883"
      - "9001:9001"
    volumes:
      - ./mosquitto/config:/mosquitto/config:ro
      - mosquitto_data:/mosquitto/data
      - mosquitto_log:/mosquitto/log

volumes:
  db_data:
  mosquitto_data:
  mosquitto_log:
