version: '3.8'
services:
  server:
    image: nanometrics-server:dev
    restart: unless-stopped
    environment:
      UDP_ADDR: "0.0.0.0:9999"
      DB_PATH: "/data/nanometrics.db"
      HTTP_ADDR: "0.0.0.0:8080"
      MQTT_BROKER: "tcp://10.0.0.3:1883"
      MQTT_TOPIC_BASE: "nanometrics/agents"
    volumes:
      - nanometrics_data:/data
    ports:
      - "9999:9999/udp"

  dashboard:
    image: ${NGINX_IMAGE:-public.ecr.aws/docker/library/nginx:alpine}
    restart: unless-stopped
    volumes:
      - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
      - ../dashboard:/usr/share/nginx/html:ro
    ports:
      - "8888:80"
    depends_on:
      - server

volumes:
  nanometrics_data:
