docker-compose.reference.yml 6.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. services:
  2. netmaker: # The Primary Server for running Netmaker
  3. privileged: true # Necessary to run sudo/root level commands on host system. Likely using this if running with host networking on.
  4. container_name: netmaker
  5. image: gravitl/netmaker:v0.10.0
  6. volumes: # Volume mounts necessary for CLIENT_MODE to control wireguard networking on host (except dnsconfig, which is where dns config files are stored for use by CoreDNS)
  7. - dnsconfig:/root/config/dnsconfig # Netmaker writes Corefile to this location, which gets mounted by CoreDNS for DNS configuration.
  8. - /usr/bin/wg:/usr/bin/wg
  9. - sqldata:/root/data
  10. cap_add: # Necessary capabilities to set iptables when running in container
  11. - NET_ADMIN
  12. - NET_RAW
  13. - SYS_MODULE
  14. sysctls:
  15. - net.ipv4.ip_forward=1
  16. - net.ipv4.conf.all.src_valid_mark=1
  17. restart: always
  18. network_mode: host # Must configure with very particular settngs for host networking to work. Do not just set on!
  19. environment:
  20. SERVER_HOST: "" # All the Docker Compose files pre-populate this with HOST_IP, which you replace as part of the install instructions. This will set both HTTP and GRPC host.
  21. SERVER_HTTP_HOST: "127.0.0.1" # Overrides SERVER_HOST if set. Useful for making HTTP and GRPC available via different interfaces/networks.
  22. SERVER_GRPC_HOST: "127.0.0.1" # Overrides SERVER_HOST if set. Useful for making HTTP and GRPC available via different interfaces/networks.
  23. API_PORT: 8081 # The HTTP API port for Netmaker. Used for API calls / communication from front end. If changed, need to change port of BACKEND_URL for netmaker-ui.
  24. GRPC_PORT: 50051 # The GRPC port for Netmaker. Used for communications from nodes.
  25. CLIENT_MODE: "on" # on if netmaker should run its own client, off if not.
  26. MASTER_KEY: "secretkey" # The admin master key for accessing the API. Change this in any production installation.
  27. CORS_ALLOWED_ORIGIN: "*" # The "allowed origin" for API requests. Change to restrict where API requests can come from.
  28. REST_BACKEND: "on" # Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to "off" to turn off.
  29. AGENT_BACKEND: "on" # Enables the AGENT backend (GRPC running on GRPC_PORT at SERVER_GRPC_HOST). Change to "off" to turn off.
  30. DNS_MODE: "on" # Enables DNS Mode, meaning config files will be generated for CoreDNS. Note, turning "off" does not remove CoreDNS. You still need to remove CoreDNS from compose file.
  31. DISABLE_REMOTE_IP_CHECK: "off" # If turned "on", Server will not set Host based on remote IP check. This is already overridden if SERVER_HOST is set. Turned "off" by default.
  32. GRPC_SSL: "off" # Tells clients to use SSL to connect to GRPC. Switch to on to turn on.
  33. COREDNS_ADDR: "" # Address of the CoreDNS server. Defaults to SERVER_HOST
  34. DISPLAY_KEYS: "on" # Show keys permanently in UI (until deleted) as opposed to 1-time display.
  35. SERVER_API_CONN_STRING: "" # Changes the api connection string. IP:PORT format. By default is empty and uses SERVER_HOST:API_PORT
  36. SERVER_GRPC_CONN_STRING: "" # Changes the grpc connection string. IP:PORT format. By default is empty and uses SERVER_HOST:GRPC_PORT
  37. RCE: "off" # Enables setting PostUp and PostDown (arbitrary commands) on nodes from the server. Off by default.
  38. NODE_ID: "" # Sets the name/id of the nodes that the server creates. Necessary for HA configurations to identify between servers (for instance, netmaker-1, netmaker-2, etc). For non-HA deployments, is not necessary.
  39. TELEMETRY: "on" # Whether or not to send telemetry data to help improve Netmaker. Switch to "off" to opt out of sending telemetry.
  40. MQ_HOST: "mq" # the address of the mq server. If running from docker compose it will be "mq". Otherwise, need to input address. If using "host networking", it will find and detect the IP of the mq container.
  41. HOST_NETWORK: "off" # whether or not host networking is turned on. Only turn on if configured for host networking (see docker-compose.hostnetwork.yml). Will set host-level settings like iptables.
  42. MANAGE_IPTABLES: "on" # set iptables on the machine being managed in order to forward properly from wireguard interface to MQ and other services listed in "port forward services"
  43. PORT_FORWARD_SERVICES: "mq,dns,ssh" #services for which to configure port forwarding on the machine. 'ssh' forwards port 22 over wireguard, enabling ssh to server over wireguard. dns enables private dns over wireguard. mq enables mq.
  44. netmaker-ui: # The Netmaker UI Component
  45. container_name: netmaker-ui
  46. depends_on:
  47. - netmaker
  48. image: gravitl/netmaker-ui:v0.10.0
  49. links:
  50. - "netmaker:api"
  51. ports:
  52. - "8082:80"
  53. environment:
  54. BACKEND_URL: "http://HOST_IP:8081" # URL where UI will send API requests. Change based on SERVER_HOST, SERVER_HTTP_HOST, and API_PORT
  55. restart: always
  56. coredns: # The DNS Server. Remove this section if DNS_MODE="off"
  57. depends_on:
  58. - netmaker
  59. image: coredns/coredns
  60. command: -conf /root/dnsconfig/Corefile
  61. container_name: coredns
  62. restart: always
  63. volumes:
  64. - dnsconfig:/root/dnsconfig
  65. caddy:
  66. image: caddy:latest
  67. container_name: caddy
  68. restart: unless-stopped
  69. network_mode: host # Wants ports 80 and 443!
  70. volumes:
  71. - /root/Caddyfile:/etc/caddy/Caddyfile
  72. # - $PWD/site:/srv # you could also serve a static site in site folder
  73. - caddy_data:/data
  74. - caddy_conf:/config
  75. mq: # the MQTT broker for netmaker
  76. image: eclipse-mosquitto:2.0.14
  77. container_name: mq
  78. restart: unless-stopped
  79. ports:
  80. - "1883:1883"
  81. volumes:
  82. - /root/mosquitto.conf:/mosquitto/config/mosquitto.conf # need to pull conf file from github before running (under docker/mosquitto.conf)
  83. - mosquitto_data:/mosquitto/data
  84. - mosquitto_logs:/mosquitto/log
  85. volumes:
  86. caddy_data: {} # storage for caddy data
  87. caddy_conf: {} # storage for caddy configuration file
  88. sqldata: {} # storage for embedded sqlite
  89. dnsconfig: {} # storage for coredns
  90. mosquitto_data: {} # storage for mqtt data
  91. mosquitto_logs: {} # storage for mqtt logs