services:
  micronomicon:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "127.0.0.1:8080:8080"
    environment:
      - PAGES_DIR=/data/pages
      - SOURCES_DIR=/data/sources
      - NOMADNET_CONTAINER=nomadnet
      - RNS_CONFIG_DIR=/rns
      - RNS_SERVER_CONFIG_DIR=/rns-server
      - NOMADNET_CONFIG_DIR=/nomadnet
      - LOG_LEVEL=DEBUG
    volumes:
      - pages:/data/pages
      - sources:/data/sources
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./reticulum-client.conf:/rns/config
      - ./reticulum.conf:/rns-server/config
      - ./nomadnet.conf:/nomadnet/config
    restart: unless-stopped
    depends_on:
      - nomadnet

  nomadnet:
    image: ghcr.io/markqvist/nomadnet:latest
    ports:
      - "0.0.0.0:4242:4242"
    volumes:
      - pages:/root/.nomadnetwork/storage/pages
      - nomadnet-config:/root/.nomadnetwork
      - ./nomadnet.conf:/root/.nomadnetwork/config
      - ./reticulum.conf:/root/.reticulum/config
    restart: unless-stopped

volumes:
  pages:
  sources:
  nomadnet-config:
