Following the Zero to Production book for learning backend development in Rust.
There are some twist to this project, I am self hosting it with the following steps:
- Build a container and store with the GitHub container registry after every push
- Log into the VPS and stop running container
- Pull latest container from the GitHub container registry
- Run the new docker container
NB: A postgres database is created in the VPS instance.s
Running on a VPS instead of an app platform leads me to implement things like autoscaling myself via HAproxy.
The deployment of the application is done using docker-compose.
When a new version of the app is created, a container is built and stored in the docker container registry.
The docker compose file is then updated to reflect the new version and restarted.