Deployment
Here, the deployment and dockerization of our web page is going to be discussed. Please get familiar with docker documentation if you haven't done so yet
https://docs.docker.com/get-started/
1. Docker Compose Services
Our docker-compose.yml runs four key services
Service | Image/Build | Role |
|
| Nginx server; handles port 80 and proxies |
|
| The Spring Boot REST API. |
|
| Relational database. |
|
| Custom service that runs automated DB dumps via crontab. |
2. Maintenance Commands
To help a new dev manage the site, here are the main commands:
- Start everything:
docker-docker compose up -d - Stop everything:
(you can add -v flag to delete all volumes)docker-docker compose down - View Backend Logs:
docker compose logs -froboteam-website-backend - Check Backups: Logs are stored in
./db_backup/logsand actual dumps are in./db_backup/backups. - Build: When in frontend/ or backend/ route directories use:
docker build . -t roboteamtwente/website-{name, e.g. "frontend"}:{version} - Pushing: First login to
roboteamRoboTeam docker account on your device.thenThen ->docker push roboteamtwente/website-{name, e.g. "frontend"}:{version}
5. Docker Compose Services
3. Deployment
When you are done developing, please consider building the images of services and push them.
After that you are able to ssh into our VPS that hosts a lot of products (main landing page included).
ssh user@h2960363.stratoserver.net
You have to add your user to that VPS's whitelist beforehand in order to login.
In there:1)
sudo -ito switch tosuper user.superuser.2)cd dockerto the main directory where all containers are started from.3)vimand edit the used version of desired service(s) to the newest one.docker.docker-compose.yml4)docker pull roboteamtwente/name:versionpull desired updated images5)docker compose up -d nameOfTheContainerstart the container(s)