docker-compose.yml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. version: "3.4"
  2. services:
  3. netmaker:
  4. container_name: netmaker
  5. image: gravitl/netmaker:$SERVER_IMAGE_TAG
  6. env_file: ./netmaker.env
  7. restart: always
  8. volumes:
  9. - dnsconfig:/root/config/dnsconfig
  10. - sqldata:/root/data
  11. environment:
  12. # config-dependant vars
  13. - STUN_SERVERS=stun1.l.google.com:19302,stun2.l.google.com:19302,stun3.l.google.com:19302,stun4.l.google.com:19302
  14. # The domain/host IP indicating the mq broker address
  15. - BROKER_ENDPOINT=wss://broker.${NM_DOMAIN} # For EMQX broker use `BROKER_ENDPOINT=wss://broker.${NM_DOMAIN}/mqtt`
  16. # For EMQX broker (uncomment the two lines below)
  17. #- BROKER_TYPE=emqx
  18. #- EMQX_REST_ENDPOINT=http://mq:18083
  19. # The base domain of netmaker
  20. - SERVER_NAME=${NM_DOMAIN}
  21. - SERVER_API_CONN_STRING=api.${NM_DOMAIN}:443
  22. # Address of the CoreDNS server. Defaults to SERVER_HOST
  23. - COREDNS_ADDR=${SERVER_HOST}
  24. # Overrides SERVER_HOST if set. Useful for making HTTP available via different interfaces/networks.
  25. - SERVER_HTTP_HOST=api.${NM_DOMAIN}
  26. netmaker-ui:
  27. container_name: netmaker-ui
  28. image: gravitl/netmaker-ui:$UI_IMAGE_TAG
  29. env_file: ./netmaker.env
  30. environment:
  31. # config-dependant vars
  32. # URL where UI will send API requests. Change based on SERVER_HOST, SERVER_HTTP_HOST, and API_PORT
  33. BACKEND_URL: "https://api.${NM_DOMAIN}"
  34. depends_on:
  35. - netmaker
  36. links:
  37. - "netmaker:api"
  38. restart: always
  39. caddy:
  40. image: caddy:2.8.4
  41. container_name: caddy
  42. env_file: ./netmaker.env
  43. restart: unless-stopped
  44. extra_hosts:
  45. - "host.docker.internal:host-gateway"
  46. volumes:
  47. - ./Caddyfile:/etc/caddy/Caddyfile
  48. - caddy_data:/data
  49. - caddy_conf:/config
  50. ports:
  51. - "$SERVER_HOST:80:80/tcp"
  52. - "$SERVER_HOST:443:443/tcp"
  53. #uncomment to enable IPv6 communication
  54. # - "$SERVER_HOST6:80:80/tcp"
  55. # - "$SERVER_HOST6:443:443/tcp"
  56. coredns:
  57. #network_mode: host
  58. container_name: coredns
  59. image: coredns/coredns:1.10.1
  60. command: -conf /root/dnsconfig/Corefile
  61. env_file: ./netmaker.env
  62. restart: always
  63. depends_on:
  64. - netmaker
  65. volumes:
  66. - dnsconfig:/root/dnsconfig
  67. mq:
  68. container_name: mq
  69. image: eclipse-mosquitto:2.0.15-openssl
  70. env_file: ./netmaker.env
  71. depends_on:
  72. - netmaker
  73. restart: unless-stopped
  74. command: [ "/mosquitto/config/wait.sh" ]
  75. volumes:
  76. - ./mosquitto.conf:/mosquitto/config/mosquitto.conf
  77. - ./wait.sh:/mosquitto/config/wait.sh
  78. - mosquitto_logs:/mosquitto/log
  79. - mosquitto_data:/mosquitto/data
  80. volumes:
  81. caddy_data: { } # runtime data for caddy
  82. caddy_conf: { } # configuration file for Caddy
  83. sqldata: { }
  84. dnsconfig: { } # storage for coredns
  85. mosquitto_logs: { } # storage for mqtt logs
  86. mosquitto_data: { } # storage for mqtt data