docker-compose.reference.yml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. version: "3.4"
  2. services:
  3. netmaker: # The Primary Server for running Netmaker
  4. container_name: netmaker
  5. image: gravitl/netmaker:REPLACE_SERVER_IMAGE_TAG
  6. restart: always
  7. volumes: # Volume mounts necessary for sql, coredns, and mqtt
  8. - dnsconfig:/root/config/dnsconfig
  9. - sqldata:/root/data
  10. - shared_certs:/etc/netmaker
  11. environment: # Necessary capabilities to set iptables when running in container
  12. BROKER_ENDPOINT: "wss://broker.NETMAKER_BASE_DOMAIN" # The domain/host IP indicating the mq broker address
  13. SERVER_NAME: "NETMAKER_BASE_DOMAIN" # The base domain of netmaker
  14. SERVER_HOST: "SERVER_PUBLIC_IP" # Set to public IP of machine.
  15. SERVER_HTTP_HOST: "api.NETMAKER_BASE_DOMAIN" # Overrides SERVER_HOST if set. Useful for making HTTP available via different interfaces/networks.
  16. SERVER_API_CONN_STRING: "api.NETMAKER_BASE_DOMAIN:443"
  17. COREDNS_ADDR: "SERVER_PUBLIC_IP" # Address of the CoreDNS server. Defaults to SERVER_HOST
  18. DNS_MODE: "on" # Enables DNS Mode, meaning all nodes will set hosts file for private dns settings.
  19. 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.
  20. REST_BACKEND: "on" # Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to "off" to turn off.
  21. 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.
  22. TELEMETRY: "on" # Whether or not to send telemetry data to help improve Netmaker. Switch to "off" to opt out of sending telemetry.
  23. MASTER_KEY: "REPLACE_MASTER_KEY" # The admin master key for accessing the API. Change this in any production installation.
  24. CORS_ALLOWED_ORIGIN: "*" # The "allowed origin" for API requests. Change to restrict where API requests can come from with comma-separated URLs. ex:- https://dashboard.netmaker.domain1.com,https://dashboard.netmaker.domain2.com
  25. DISPLAY_KEYS: "on" # Show keys permanently in UI (until deleted) as opposed to 1-time display.
  26. DATABASE: "sqlite" # Database to use - sqlite, postgres, or rqlite
  27. NODE_ID: "netmaker-server-1" # used for HA - identifies this server vs other servers
  28. SERVER_BROKER_ENDPOINT: ""ws://mq:1883"" # 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.
  29. MQ_USERNAME: "REPLACE_MQ_USERNAME" # the username to set for MQ access
  30. MQ_PASSWORD: "REPLACE_MQ_PASSWORD" # the password to set for MQ access
  31. STUN_PORT: "3478" # the reachable port of STUN on the server
  32. VERBOSITY: "1" # logging verbosity level - 1, 2, or 3
  33. # this section is for OAuth
  34. AUTH_PROVIDER: "" # "<azure-ad|github|google|oidc>"
  35. CLIENT_ID: "" # "<client id of your oauth provider>"
  36. CLIENT_SECRET: "" # "<client secret of your oauth provider>"
  37. FRONTEND_URL: "" # "https://dashboard.<netmaker base domain>"
  38. AZURE_TENANT: "" # "<only for azure, you may optionally specify the tenant for the OAuth>"
  39. OIDC_ISSUER: "" # https://oidc.yourprovider.com - URL of oidc provider
  40. ports:
  41. - "3478:3478/udp" # the stun port
  42. netmaker-ui: # The Netmaker UI Component
  43. container_name: netmaker-ui
  44. image: gravitl/netmaker-ui:REPLACE_UI_IMAGE_TAG
  45. depends_on:
  46. - netmaker
  47. links:
  48. - "netmaker:api"
  49. restart: always
  50. environment:
  51. BACKEND_URL: "https://api.NETMAKER_BASE_DOMAIN" # URL where UI will send API requests. Change based on SERVER_HOST, SERVER_HTTP_HOST, and API_PORT
  52. caddy: # The reverse proxy that manages traffic for Netmaker
  53. image: caddy:2.6.2
  54. container_name: caddy
  55. restart: unless-stopped
  56. volumes:
  57. - /root/Caddyfile:/etc/caddy/Caddyfile # Config file for Caddy
  58. - caddy_data:/data
  59. - caddy_conf:/config
  60. ports:
  61. - "80:80"
  62. - "443:443"
  63. coredns: # The DNS Server. CoreDNS can be removed unless doing special advanced use cases
  64. container_name: coredns
  65. image: coredns/coredns
  66. command: -conf /root/dnsconfig/Corefile
  67. depends_on:
  68. - netmaker
  69. restart: always
  70. volumes:
  71. - dnsconfig:/root/dnsconfig
  72. mq: # the mqtt broker for netmaker
  73. container_name: mq
  74. image: eclipse-mosquitto:2.0.15-openssl
  75. depends_on:
  76. - netmaker
  77. restart: unless-stopped
  78. command: ["/mosquitto/config/wait.sh"]
  79. environment:
  80. MQ_PASSWORD: "REPLACE_MQ_PASSWORD" # must be same value as in netmaker env
  81. MQ_USERNAME: "REPLACE_MQ_USERNAME" # must be same value as in netmaker env
  82. volumes:
  83. - /root/mosquitto.conf:/mosquitto/config/mosquitto.conf
  84. - /root/wait.sh:/mosquitto/config/wait.sh
  85. - mosquitto_logs:/mosquitto/log
  86. ports:
  87. - "1883:1883"
  88. - "8883:8883"
  89. volumes:
  90. caddy_data: {} # runtime data for caddy
  91. caddy_conf: {} # configuration file for Caddy
  92. shared_certs: {} # netmaker certs generated for MQ comms - used by nodes/servers
  93. sqldata: {} # storage for embedded sqlite
  94. dnsconfig: {} # storage for coredns
  95. mosquitto_logs: {} # storage for mqtt logs