|
Part 2
The second part of the project is deploy.
For this we use a server from AWS.
We created a EC2 machine running Ubuntu 20.04 LTS.
After this we installed neccessary software:
- OpenJDK and JRE
- Gitlab-runner
- Node.js (not from APT, since it's outdated)
- Docker
Then we had to register our gitlab-runner to use it. It was done separately for front and back.
It was neccessary to install it in shell mode so we could use it to manage our files.
To use our gitlab-runner a new file called ".gitlab-ci.yml" was neccessary.
Its location is in the root of our repo.
To make use of our Docker-based database, we added Dockerfile to our api and added api-deploy to docker-compose.yml
Same was done for front-end
To use vue, from npm we installed vue and vue-cli-service.
We added Docker-specific info to Dockerfile from https://cli.vuejs.org/guide/deployment.html#docker-nginx.
Its last 4 rows with minor edits.
To use nginx, it had to be installed as well.
https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04
https://thucnc.medium.com/deploy-a-vuejs-web-app-with-nginx-on-ubuntu-18-04-f93860219030
Using these we got the front mostly-working but proxy was needed as well, so we got it's confix from here:
https://medium.com/homullus/vuejs-dev-serve-with-reverse-proxy-cdc3c9756aeb
Unfortunately routing was still broken on nginx, so to fix it, I followed this:
https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations
|