Last active
August 1, 2024 13:08
-
-
Save lukepighetti/6b6a0b044ab66b917cc5daa553a81574 to your computer and use it in GitHub Desktop.
Setting up digital ocean to run a dart shelf server
This file contains 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
# 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 |
This file contains 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 = 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 |
This file contains 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
( 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 |
This file contains 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
api.lukehog.com { | |
reverse_proxy localhost:8080 | |
tls lukepighetti@gmail.com | |
} |
This file contains 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 = 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 |
This file contains 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
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