- install node.js :: brew install node.
- Use :
npm create vite@latest ./ -- --template reactto create bare react-project - Run command ::
npm install --legacy-peer-deps @react-three/fiber @react-three/drei maath react-tilt react-vertical-timeline-component @emailjs/browser framer-motion react-router-dom three react-tilt-parallaxto install necessary dependencies. Note :: react-tilt is legacy dependency , use --legacy-peer-dep flag or install react-parallax-tilt - Initialize tailwind.css:
npm install -D tailwindcss npm install --legacy-peer-deps -D postcss autoprefixer npx tailwindcss init - Run command :
npm run devto serve the UI during local development.
- Install docker via offical website :
https://www.docker.com/get-started/ - Dockerfile uses
nginxto serve production buid. - Run
docker build -t <image-name> .in directory to build the image. - Run
docker run -p <port_number> : 80 <image-name>to start UI on<port-number>. Note :- No CVEs as per docker scout scans until 8/10/2023.
- 2 stages : npm build + serve via nginx
-
Use Azure Pipelines to build and deploy to AKS. Note :: hosted parallelism for Azure Devops needs to be activated via form.
-
Alternative : Use Github Actions build and push docker image.
- Create an
Azure Container Registryeither using CLI / portal. - Enable Admin for your container registry and setup secrets for your github project.
Goto :
<repository>/settings/secrets and variables/Actions.
Define Repoistory Secrets. - Create .github/workflows/main.yml file as per requirement.
- Create an
-
Prerequisites: ** Integrate Github actions to Azure: https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-portal%2Clinux
- Run command
az ad sp create-for-rbac --name "login-service-principal" --role contributor --scopes /subscriptions/{subscription_id}/resourceGroups/{resource_group_name_of_AKS} --json-authon azure CLI or cloud shell. - Extract output JSON and set it as a secret named :
AZURE_LOGIN_CREDSin github settings. - Connect your AKS to ACR :
az aks update -n myAKSCluster -g myResourceGroup --attach-acr <acr-name>
- Run command
- Azure Devops
- Run
azure-pipelines.ymlvia Azure devops portal. - Verify container within AKS instance.
- Github Action
- aks_deploy.yml is can be triggered via workflows tab in Github .
- manifests/deployment.yml and manifests/service.yml are k8s spec files.
- Use
kubectl apply -f deployment.yml -n <namespace>to deploy UI - Use
kubectl apply -f service.yml -n <namespace>deploy service - Install
ingress-controller - Update the DNS's A record to map to ingress-controller's external IP address.
- Apply Ingress resource.
- Check out
httpbased insecure website , verify it's accessible. - Install
cert-managerusing helm. (https://cert-manager.io/docs/) - Apply
issuer.ymlandcertificate.yml. - Update the
tlssection of ingress.yml and re-apply. - Test secure https website.