The whole AWS infrastructure created with Terraform scripts. See the terraform folder for the detalies. It creates:
The terraform apply command outputs the user password, server public IP and the Domain name. To connect the EC2 instance via ssh, please, use the private key from secrets folder. Place the id_ed25519 file in your ~/.ssh folder and run:
ssh ec2-user@<server_ip>
The web application utilizes public free API from weatherapi.com. It displays current weather report in some Europian capitals. The applicatin is written in JavaScript and runs in browser. See HTML and JS sources in src folder. The NGINX configuration file is placed in nginx folder. It is a /etc/nginx/config.d/ including config file. Web application is accessable by URL like:
http://<server_addr>/weather
Access to the webserver is restricted by IP address. You can either edit terraform.tfvars setting your IP in varuable allowed_ip or update the Security group rooles.
Simple CI pipeline was built with Jenkins, please see Jenkinsfile for detailes. It has a simple quality gate which checks if the web app is accesible. If the the gate passed it builds Docker image and pushes it to the Docker Hub registry. See the Dockerfile for detailes. You can find the image dmytro108/weatherapp on the Docker Hub registry.
Deployment is a manual process. Run Docker container on the webserver:
docker run -d -p 80:80 --name weatherapp dmytro108/weatherapp:latest