Skip to content

Instantly share code, notes, and snippets.

@lukepighetti
Last active August 1, 2024 13:08
Show Gist options
  • Save lukepighetti/6b6a0b044ab66b917cc5daa553a81574 to your computer and use it in GitHub Desktop.
Save lukepighetti/6b6a0b044ab66b917cc5daa553a81574 to your computer and use it in GitHub Desktop.
Setting up digital ocean to run a dart shelf server
# install dart
sudo apt-get update && sudo apt-get install apt-transport-https
wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub \
| sudo gpg --dearmor -o /usr/share/keyrings/dart.gpg
echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' \
| sudo tee /etc/apt/sources.list.d/dart_stable.list
sudo apt-get update && sudo apt-get install dart
# install sqlite3
sudo apt install libsqlite3-dev
[Unit]
Description = ffa_server
[Service]
Type = simple
User = root
Group = root
LimitNOFILE = 4096
Restart = always
RestartSec = 5s
StandardOutput = append:/root/output.log
StandardError = append:/root/errors.log
WorkingDirectory = /root
ExecStart = /root/ffa_server
[Install]
WantedBy = multi-user.target
( cd lukehog && git pull )
( cd lukehog/ffa_server && dart pub get )
( cd lukehog/ffa_server && tasks/build )
systemctl stop ffa_server
cp lukehog/ffa_server/build/bin ffa_server
cp ffa_server.service /lib/systemd/system/
systemctl daemon-reload
systemctl restart ffa_server
api.lukehog.com {
reverse_proxy localhost:8080
tls lukepighetti@gmail.com
}
[Unit]
Description = caddy
[Service]
Type = simple
User = root
Group = root
LimitNOFILE = 4096
Restart = always
RestartSec = 5s
StandardOutput = append:/root/output.caddy.log
StandardError = append:/root/errors.caddy.log
WorkingDirectory = /root
ExecStart = /usr/bin/caddy
[Install]
WantedBy = multi-user.target
systemctl stop caddy
cp caddy.service /lib/systemd/system/
systemctl daemon-reload
systemctl restart caddy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment