At the moment, this is a server with a simple bootstrap script and a manually loaded db.
Things to do
Setup goreleaser gha so per architecture builds are added as releases within this repo and available to download
Include templates/ directory in binary
This will prevent having to use docker on the server since everything will be in a single binary
Replace docker with systemd config so app can be daemonized w/o docker
HTTPS validation
Get a non state specific domain name and ensure it's owned by CodeForNebraska admin
Improve bootstrap to include nginx tls termination and forward to golang api
Github action (or similar) to trigger deploy on a new code change
This may be tricky. We'd need to run a script on the server. We could do that using a github action that would use a separate ssh private key, and run a script. The script should pull the latest linux binary from this repo, and restart the service. The private key would need to be saved as a secret.
Terraform the linode server so it's reproducible
Doesn't seem too challenging. We're only using a single instance. An API token would need to be saved as a secret.
Current bootstrap
Current bootstrap
```bash
#!/bin/bash
## Security updates
sudo apt update
sudo apt upgrade
## Setup Docker
## TODO: remove this when the golang release process is finished
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y make docker-ce
mkdir -p /opt
git clone https://github.com/jhannah/legislature_calendar.git /opt/app
make build -f /opt/app/Makefile
## TODO: build db or manually upload leg.sqlite3
## TODO: when db storage is available, no need to use leg.sqlite3
docker run -d -p 80:80 --rm --init --tty -e PORT=80 legislative_calendar
## TODO: Setup NGINX
## TODO: Setup lets encrypt
# sudo apt install -y certbot python3-certbot-apache
```
At the moment, this is a server with a simple bootstrap script and a manually loaded db.
Things to do
Current bootstrap
Current bootstrap
```bash #!/bin/bash ## Security updates sudo apt update sudo apt upgrade ## Setup Docker ## TODO: remove this when the golang release process is finished sudo apt install -y apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update sudo apt install -y make docker-ce mkdir -p /opt git clone https://github.com/jhannah/legislature_calendar.git /opt/app make build -f /opt/app/Makefile ## TODO: build db or manually upload leg.sqlite3 ## TODO: when db storage is available, no need to use leg.sqlite3 docker run -d -p 80:80 --rm --init --tty -e PORT=80 legislative_calendar ## TODO: Setup NGINX ## TODO: Setup lets encrypt # sudo apt install -y certbot python3-certbot-apache ```references