docker-compose.reference.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. services:
  2. rqlite:
  3. container_name: rqlite
  4. image: rqlite/rqlite
  5. network_mode: host
  6. restart: always
  7. volumes:
  8. - sqldata:/rqlite/file/data
  9. netmaker: # The Primary Server for running Netmaker
  10. privileged: true # Necessary to run sudo/root level commands on host system. Take out if not running with CLIENT_MODE=on
  11. container_name: netmaker
  12. depends_on:
  13. - rqlite
  14. image: gravitl/netmaker:v0.8.5
  15. 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)
  16. - dnsconfig:/root/config/dnsconfig # Netmaker writes Corefile to this location, which gets mounted by CoreDNS for DNS configuration.
  17. - /usr/bin/wg:/usr/bin/wg
  18. cap_add: # Necessary for CLIENT_MODE. Should be removed if turned off.
  19. - NET_ADMIN
  20. restart: always
  21. network_mode: host # Necessary for CLIENT_MODE. Should be removed if turned off, but then need to add port mappings
  22. environment:
  23. 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.
  24. SERVER_HTTP_HOST: "127.0.0.1" # Overrides SERVER_HOST if set. Useful for making HTTP and GRPC available via different interfaces/networks.
  25. SERVER_GRPC_HOST: "127.0.0.1" # Overrides SERVER_HOST if set. Useful for making HTTP and GRPC available via different interfaces/networks.
  26. 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.
  27. GRPC_PORT: 50051 # The GRPC port for Netmaker. Used for communications from nodes.
  28. CLIENT_MODE: "on" # on if netmaker should run its own client, off if not.
  29. MASTER_KEY: "secretkey" # The admin master key for accessing the API. Change this in any production installation.
  30. CORS_ALLOWED_ORIGIN: "*" # The "allowed origin" for API requests. Change to restrict where API requests can come from.
  31. REST_BACKEND: "on" # Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to "off" to turn off.
  32. AGENT_BACKEND: "on" # Enables the AGENT backend (GRPC running on GRPC_PORT at SERVER_GRPC_HOST). Change to "off" to turn off.
  33. 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.
  34. 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.
  35. GRPC_SSL: "off" # Tells clients to use SSL to connect to GRPC. Switch to on to turn on.
  36. COREDNS_ADDR: "" # Address of the CoreDNS server. Defaults to SERVER_HOST
  37. SERVER_API_CONN_STRING: "" # Changes the api connection string. IP:PORT format. By default is empty and uses SERVER_HOST:API_PORT
  38. SERVER_GRPC_CONN_STRING: "" # Changes the grpc connection string. IP:PORT format. By default is empty and uses SERVER_HOST:GRPC_PORT
  39. netmaker-ui: # The Netmaker UI Component
  40. container_name: netmaker-ui
  41. depends_on:
  42. - netmaker
  43. image: gravitl/netmaker-ui:v0.7
  44. links:
  45. - "netmaker:api"
  46. ports:
  47. - "8082:80"
  48. environment:
  49. BACKEND_URL: "http://HOST_IP:8081" # URL where UI will send API requests. Change based on SERVER_HOST, SERVER_HTTP_HOST, and API_PORT
  50. coredns: # The DNS Server. Remove this section if DNS_MODE="off"
  51. depends_on:
  52. - netmaker
  53. image: coredns/coredns
  54. command: -conf /root/dnsconfig/Corefile # Config location for Corefile. This is the path of file which is also mounted to Netmaker for modification.
  55. container_name: coredns
  56. restart: always
  57. ports:
  58. - "53:53/udp" # Likely needs to run at port 53 for adequate nameserver usage.
  59. volumes:
  60. - dnsconfig:/root/dnsconfig
  61. volumes:
  62. sqldata: {}
  63. dnsconfig: {}