pipeline { agent any environment { // Tag images with the build number so they are unique FRONTEND_IMAGE = "chore-app-backend:${env.BUILD_ID}" BACKEND_IMAGE = "chore-app-frontend:${env.BUILD_ID}" } stages { stage('Checkout') { steps { // Pulls code from your configured Git repo checkout scm } } stage('Build Frontend (Vue) App') { steps { dir('web/vue-app') { sh 'docker build -t ${FRONTEND_IMAGE} .' } } } stage('Build Backend (Flask) App') { steps { dir('.') { sh 'docker build -t ${BACKEND_IMAGE} .' } } } stage('Cleanup') { steps { // Optional: Stop old containers and run the new ones // Note: In production, you would push to a registry (DockerHub) instead sh "echo 'Build Complete. Images ready: ${FRONTEND_IMAGE} and ${BACKEND_IMAGE}'" } } } }