TLDR:
- Zips up files needed to run
- Setups environment on remote machine and pushes zipped stuff via scp
- Setups project, installs deps and systemd service on autorestart
- Maps ports 3000 as 443 and 3001 as 80 using iptables (clears iptables each push)
Idea behind this repo is that you want to create a small app/bot/worker so you are renting a vps-ish instance like AWS ec2 and this repo is just quick and dirty way to kickoff project.
I want to extract parts of this project into more general setup - like running stuff like rust or python, you can actually modify the deploy.sh to install stuff needed for your specific environment.
- Clone repo and break origin link OR use
Use as template
functionality provided by github - Copy
secret.env.template
assecret.env
-secret.env
is gitignored - Change
secret.env
content, for more info you can check "secret.env vars breakdown" paragraph
Keep in mind that private key should have
700
file perms
- Check
deploy.sh
content, there are security risks (like not checking fingerprints) to make deployment process input-less - Make sure you have zip command installed - more info in
deploy.sh
(TODO: move it to readme)
// TODO