Download your project from GitHub.
git clone https://github.com/Murali-Kaspa/HotelBooking.git
cd HotelBooking
Inside the project folder, create a Dockerfile.
nano Dockerfile
Copy this into Dockerfile.
FROM nginx
COPY . /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
docker build -t my-webapp .
docker run -d -p 80:80 --name my-webapp-container my-webapp
docker run -d --name sonarqube -p 9000:9000 sonarqube:lts
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-5.0.1.3006-linux.tar.gz
tar -xvzf sonar-scanner-5.0.1.3006-linux.tar.gz
sudo mv sonar-scanner-5.0.1.3006-linux /opt/sonar-scanner
echo 'export PATH=$PATH:/opt/sonar-scanner/bin' >> ~/.bashrc
source ~/.bashrc
nano sonar-project.properties
sonar-scanner
Your web app is deployed using Docker, and its code is analyzed with SonarQube!