Manual Deployment

How to build and autostart DaSCR-Board using systemd

Basically it is as easy as running through the getting started guide on your remote server.

Autostart backend using systemd

If you have successfully built the backend and the frontend you will have the backend binary in place and the public folder for serving with for example caddy2.

You can now use this systemd service file to automate the startup of the backend binary like so:

[Unit]
Description=DaSCR Board - Backend API
After=network.target

[Service]
Type=simple
User=patrick
Group=patrick
Restart=always
RestartSec=5s

Environment=API_IP=0.0.0.0
Environment=API_PORT=8000

WorkingDirectory=/home/patrick/projects/dascr-board
ExecStart=/home/patrick/projects/dascr-board/dist/linux_amd64/dascr-board
SyslogIdentifier=dascr-board

[Install]
WantedBy=multi-user.target

Save it at /etc/systemd/system/dascr-board.service.

Then run:

sudo systemctl daemon-reload
sudo systemctl start dascr-board
sudo systemctl enable dascr-board

Now the service should be up and running and be started at system boot time automatically.

You can check running sudo systemctl status dascr-board.

What’s next?

  • Caddy2: You might wanna continue setting up caddy2 server to serve the frontend UI