docker-compose.reference copy.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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:
  10. depends_on:
  11. - rqlite
  12. privileged: true
  13. container_name: netmaker
  14. image: gravitl/netmaker:v0.7
  15. volumes:
  16. - ./:/local
  17. - /etc/netclient:/etc/netclient
  18. - dnsconfig:/root/config/dnsconfig
  19. - /usr/bin/wg:/usr/bin/wg
  20. - /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
  21. - /run/systemd/system:/run/systemd/system
  22. - /etc/systemd/system:/etc/systemd/system
  23. - /sys/fs/cgroup:/sys/fs/cgroup
  24. cap_add:
  25. - NET_ADMIN
  26. - SYS_MODULE
  27. restart: always
  28. network_mode: host
  29. environment:
  30. SERVER_HOST: "SERVER_PUBLIC_IP"
  31. SERVER_API_CONN_STRING: "api.NETMAKER_BASE_DOMAIN:443"
  32. SERVER_GRPC_CONN_STRING: "grpc.NETMAKER_BASE_DOMAIN:1443"
  33. COREDNS_ADDR: "SERVER_PUBLIC_IP"
  34. GRPC_SSL: "on"
  35. SERVER_HTTP_HOST: "api.NETMAKER_BASE_DOMAIN"
  36. SERVER_GRPC_HOST: "grpc.NETMAKER_BASE_DOMAIN"
  37. API_PORT: "8081"
  38. GRPC_PORT: "50051"
  39. CLIENT_MODE: "on"
  40. MASTER_KEY: "REPLACE_MASTER_KEY"
  41. SERVER_GRPC_WIREGUARD: "off"
  42. CORS_ALLOWED_ORIGIN: "*"
  43. netmaker-ui:
  44. container_name: netmaker-ui
  45. depends_on:
  46. - netmaker
  47. image: gravitl/netmaker-ui:v0.7
  48. links:
  49. - "netmaker:api"
  50. ports:
  51. - "8082:80"
  52. environment:
  53. BACKEND_URL: "https://api.NETMAKER_BASE_DOMAIN"
  54. coredns:
  55. depends_on:
  56. - netmaker
  57. image: coredns/coredns
  58. command: -conf /root/dnsconfig/Corefile
  59. container_name: coredns
  60. restart: always
  61. ports:
  62. - "53:53/udp"
  63. volumes:
  64. - dnsconfig:/root/dnsconfig
  65. version: "3.4"
  66. services:
  67. rqlite: # The rqlite instance that backs up Netmaker
  68. container_name: rqlite
  69. image: rqlite/rqlite
  70. network_mode: host
  71. restart: always
  72. volumes:
  73. - sqldata:/rqlite/file/data
  74. netmaker: # The Primary Server for running Netmaker
  75. privileged: true # Necessary to run sudo/root level commands on host system. Take out if not running with CLIENT_MODE=on
  76. container_name: netmaker
  77. depends_on:
  78. - mongodb
  79. image: gravitl/netmaker:v0.7
  80. volumes: # Volume mounts necessary for Netmaker to control netclient, wireguard, and networking on host (except dnsconfig, which is where dns config files are stored for use by CoreDNS)
  81. - ./:/local
  82. - /etc/netclient:/etc/netclient
  83. - dnsconfig:/root/config/dnsconfig # Netmaker writes Corefile to this location, which gets mounted by CoreDNS for DNS configuration.
  84. - /usr/bin/wg:/usr/bin/wg
  85. - /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
  86. - /run/systemd/system:/run/systemd/system
  87. - /etc/systemd/system:/etc/systemd/system
  88. - /sys/fs/cgroup:/sys/fs/cgroup
  89. cap_add: # Necessary for CLIENT_MODE. Should be removed if turned off.
  90. - NET_ADMIN
  91. - SYS_MODULE
  92. restart: always
  93. network_mode: host # Necessary for CLIENT_MODE. Should be removed if turned off, but then need to add port mappings
  94. environment:
  95. GRPC_SSL: "off" # Tells clients to use SSL to connect to GRPC. Switch to on to turn on.
  96. SERVER_API_CONN_STRING: "" # Changes the api connection string. IP:PORT format. By default is empty and uses SERVER_HOST:API_PORT
  97. SERVER_GRPC_CONN_STRING: "" # Changes the grpc connection string. IP:PORT format. By default is empty and uses SERVER_HOST:GRPC_PORT
  98. 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.
  99. 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.
  100. GRPC_PORT: 50051 # The GRPC port for Netmaker. Used for communications from nodes.
  101. MASTER_KEY: "secretkey" # The admin master key for accessing the API. Change this in any production installation.
  102. CORS_ALLOWED_ORIGIN: "*" # The "allowed origin" for API requests. Change to restrict where API requests can come from.
  103. REST_BACKEND: "on" # Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to "off" to turn off.
  104. AGENT_BACKEND: "on" # Enables the AGENT backend (GRPC running on GRPC_PORT at SERVER_GRPC_HOST). Change to "off" to turn off.
  105. 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.
  106. netmaker-ui: # The Netmaker UI Component
  107. container_name: netmaker-ui
  108. depends_on:
  109. - netmaker
  110. image: gravitl/netmaker-ui:v0.7
  111. links:
  112. - "netmaker:api"
  113. ports:
  114. - "8082:80"
  115. environment:
  116. BACKEND_URL: "http://HOST_IP:8081" # URL where UI will send API requests. Change based on SERVER_HOST, SERVER_HTTP_HOST, and API_PORT
  117. coredns: # The DNS Server. Remove this section if DNS_MODE="off"
  118. depends_on:
  119. - netmaker
  120. image: coredns/coredns
  121. command: -conf /root/dnsconfig/Corefile # Config location for Corefile. This is the path of file which is also mounted to Netmaker for modification.
  122. container_name: coredns
  123. restart: always
  124. ports:
  125. - "53:53/udp" # Likely needs to run at port 53 for adequate nameserver usage.
  126. volumes:
  127. - dnsconfig:/root/dnsconfig
  128. volumes:
  129. sqldata: {}
  130. dnsconfig: {}