- Place the file to directory
/etc/systemd/system/
- Customise line 21
--network streamr \
to match your Docker network or remove it to use the default network (not recommended) - Customise line 25
--volume /host/broker/config/dir:/root/.streamr:rw \
replace/host/broker/config/dir
with the directory of youbroker-config.json
file. - Current configuration exposes WebSocket plugin port 7170 to public internet. You may open other ports for plugins if you like. For example to publish MQTT port add:
--publish 1883:1883/tcp \
- Run
sudo systemctl enable /etc/systemd/system/streamr-broker-node.service
- Run
sudo systemctl start streamr-broker-node
- Check logs with
sudo journalctl -xefu streamr-broker-node
or if you havepino-pretty
installed usesudo journalctl -xefu streamr-broker-node | pino-pretty -t
Last active
May 21, 2023 13:16
-
-
Save kare/a0615a2a4a83491d422ac7cc75934553 to your computer and use it in GitHub Desktop.
Systemd unit file Streamr Broker Node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Streamr Broker Node | |
After=docker.service | |
Requires=docker.service | |
[Service] | |
TimeoutStartSec=0 | |
Type=simple | |
Restart=always | |
RestartSec=5 | |
ExecStartPre=-/usr/bin/docker stop --time 0 %N | |
ExecStartPre=-/usr/bin/docker rm --force %N | |
ExecStart=/usr/bin/docker run \ | |
--name %N \ | |
--hostname %N \ | |
--security-opt no-new-privileges=true \ | |
--security-opt apparmor=docker-default \ | |
--log-driver journald \ | |
--pull always \ | |
--restart unless-stopped \ | |
--network streamr \ | |
--memory 250M \ | |
--memory-swap 300M \ | |
--cpus 2 \ | |
--volume /host/broker/config/dir:/root/.streamr:rw \ | |
--publish 7170:7170/tcp \ | |
--env NODE_ENV=production \ | |
--env LOG_LEVEL=info \ | |
streamr/broker-node:latest | |
ExecStop=/usr/bin/docker stop --time 5 %N | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment