# Meshnet relay-only stack for Portainer.
#
# Use this when you want to run a relay-only node separately from the tracker.
# The default alpha tracker stack embeds the same relay implementation in the
# tracker process, so this file is optional until relay traffic needs its own
# host/container.
#
# Intended topology for a relay-only public host:
#   https://YOUR_DOMAIN/ws    -> meshnet-relay:8765  (WebSocket)
#   https://YOUR_DOMAIN/rpc/* -> meshnet-relay:8765  (WebSocket)
#
# If the tracker is separate, start it with:
#   --relay-url wss://YOUR_DOMAIN/ws

services:
  meshnet-relay:
    image: ${MESHNET_IMAGE:-git.d-popov.com/popov/neuron-tai-tracker:alpha}
    container_name: meshnet-relay
    restart: unless-stopped
    command: ["meshnet-relay", "--host", "0.0.0.0", "--port", "8765", "--log-level", "INFO"]
    expose:
      - "8765"
    healthcheck:
      test: ["CMD", "python", "-c", "import socket; s=socket.create_connection(('127.0.0.1', 8765), 3); s.close()"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 10s
    networks:
      - public-proxy

networks:
  public-proxy:
    external: true
    name: ${PUBLIC_PROXY_NETWORK:-proxy_net}
