netmaker/compose/docker-compose.reference.yml

95 lines
5.5 KiB
YAML
Raw Normal View History

2021-05-17 23:55:03 +08:00
services:
2021-05-19 01:55:06 +08:00
netmaker: # The Primary Server for running Netmaker
2022-02-09 11:22:16 +08:00
privileged: true # Necessary to run sudo/root level commands on host system. Likely using this if running with host networking on.
2021-05-17 23:55:03 +08:00
container_name: netmaker
image: gravitl/netmaker:v0.14.5
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)
2021-05-19 01:55:06 +08:00
- dnsconfig:/root/config/dnsconfig # Netmaker writes Corefile to this location, which gets mounted by CoreDNS for DNS configuration.
2022-02-09 11:22:16 +08:00
- sqldata:/root/data
2022-04-26 23:02:21 +08:00
- /root/certs:/etc/netmaker/ # cert management location
2022-02-09 11:22:16 +08:00
cap_add: # Necessary capabilities to set iptables when running in container
2021-05-17 23:55:03 +08:00
- NET_ADMIN
2022-02-09 11:22:16 +08:00
- NET_RAW
- SYS_MODULE
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1
2022-04-26 22:41:44 +08:00
- net.ipv6.conf.all.disable_ipv6=0
2022-05-02 22:48:00 +08:00
- net.ipv6.conf.all.forwarding=1
2021-05-17 23:55:03 +08:00
restart: always
2022-02-09 11:22:16 +08:00
network_mode: host # Must configure with very particular settngs for host networking to work. Do not just set on!
2021-05-19 01:55:06 +08:00
environment:
2022-04-26 23:02:21 +08:00
SERVER_NAME: "" # The domain/host IP indicating the mq broker address
2022-04-22 03:53:44 +08:00
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 the HTTP host.
SERVER_HTTP_HOST: "127.0.0.1" # Overrides SERVER_HOST if set. Useful for making HTTP available via different interfaces/networks.
2021-05-19 01:55:06 +08:00
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.
CLIENT_MODE: "on" # on if netmaker should run its own client, off if not.
2021-05-19 01:55:06 +08:00
MASTER_KEY: "secretkey" # The admin master key for accessing the API. Change this in any production installation.
CORS_ALLOWED_ORIGIN: "*" # The "allowed origin" for API requests. Change to restrict where API requests can come from.
REST_BACKEND: "on" # Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to "off" to turn off.
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.
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.
2021-08-11 11:27:13 +08:00
COREDNS_ADDR: "" # Address of the CoreDNS server. Defaults to SERVER_HOST
2021-11-17 11:39:28 +08:00
DISPLAY_KEYS: "on" # Show keys permanently in UI (until deleted) as opposed to 1-time display.
2021-07-19 07:52:10 +08:00
SERVER_API_CONN_STRING: "" # Changes the api connection string. IP:PORT format. By default is empty and uses SERVER_HOST:API_PORT
2022-01-18 00:28:28 +08:00
RCE: "off" # Enables setting PostUp and PostDown (arbitrary commands) on nodes from the server. Off by default.
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.
TELEMETRY: "on" # Whether or not to send telemetry data to help improve Netmaker. Switch to "off" to opt out of sending telemetry.
2022-02-09 11:22:16 +08:00
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.
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.
2022-05-03 23:40:45 +08:00
MANAGE_IPTABLES: "on" # deprecated
PORT_FORWARD_SERVICES: "dns" # decide which services to port forward ("dns","ssh", or "mq")
2022-04-26 23:02:21 +08:00
ports:
- "51821-51830:51821-51830/udp"
- "8081:8081"
2021-05-19 01:55:06 +08:00
netmaker-ui: # The Netmaker UI Component
2021-05-17 23:55:03 +08:00
container_name: netmaker-ui
depends_on:
- netmaker
image: gravitl/netmaker-ui:v0.14.5
2021-05-17 23:55:03 +08:00
links:
- "netmaker:api"
ports:
2021-08-11 11:27:13 +08:00
- "8082:80"
2021-05-17 23:55:03 +08:00
environment:
2021-05-19 01:55:06 +08:00
BACKEND_URL: "http://HOST_IP:8081" # URL where UI will send API requests. Change based on SERVER_HOST, SERVER_HTTP_HOST, and API_PORT
2022-02-09 11:22:16 +08:00
restart: always
2021-05-19 01:55:06 +08:00
coredns: # The DNS Server. Remove this section if DNS_MODE="off"
2021-05-17 23:55:03 +08:00
depends_on:
- netmaker
image: coredns/coredns
2022-02-09 11:22:16 +08:00
command: -conf /root/dnsconfig/Corefile
2021-05-17 23:55:03 +08:00
container_name: coredns
restart: always
volumes:
- dnsconfig:/root/dnsconfig
2022-02-09 11:22:16 +08:00
caddy:
image: caddy:latest
container_name: caddy
restart: unless-stopped
network_mode: host # Wants ports 80 and 443!
volumes:
- /root/Caddyfile:/etc/caddy/Caddyfile
# - $PWD/site:/srv # you could also serve a static site in site folder
- caddy_data:/data
- caddy_conf:/config
mq: # the MQTT broker for netmaker
2022-04-26 23:02:21 +08:00
image: eclipse-mosquitto:2.0.11-openssl
2022-02-09 11:22:16 +08:00
container_name: mq
restart: unless-stopped
ports:
2022-04-26 22:41:44 +08:00
- "127.0.0.1:1883:1883"
- "8883:8883"
2022-02-09 11:22:16 +08:00
volumes:
- /root/mosquitto.conf:/mosquitto/config/mosquitto.conf # need to pull conf file from github before running (under docker/mosquitto.conf)
- mosquitto_data:/mosquitto/data
- mosquitto_logs:/mosquitto/log
2022-04-26 23:02:21 +08:00
- /root/certs/:/mosquitto/certs/
2021-05-17 23:55:03 +08:00
volumes:
2022-02-09 11:22:16 +08:00
caddy_data: {} # storage for caddy data
caddy_conf: {} # storage for caddy configuration file
sqldata: {} # storage for embedded sqlite
dnsconfig: {} # storage for coredns
mosquitto_data: {} # storage for mqtt data
2022-02-22 05:24:44 +08:00
mosquitto_logs: {} # storage for mqtt logs