From ddc1da1421179211beb621f47d2199b39d4e84eb Mon Sep 17 00:00:00 2001 From: ash2code Date: Mon, 20 May 2024 18:15:34 +0000 Subject: [PATCH] initial commit to prod branch --- Dockerfile | 6 ++++++ Jenkinsfile | 30 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 Dockerfile create mode 100644 Jenkinsfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0ad1c47 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3.9-slim +WORKDIR /app +COPY . . +RUN pip install --no-cache-dir -r requirements.txt +EXPOSE 5000 +CMD ["flask", "run", "--host=0.0.0.0"] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..a89031b --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,30 @@ +pipeline { + agent any + + environment { + IMAGE_NAME = "ash2code/library" + } + + stages { + stage("code-checkout") { + steps { + git changelog: false, poll: false, url: 'https://github.com/ash2code/library-management-system.git' + } + } + stage("docker-build") { + steps { + sh "docker build -t $IMAGE_NAME:${env.BRANCH_NAME} ." + } + } + stage("images-list") { + steps { + sh "docker images -a" + } + } + stage("docker-run") { + steps { + sh "docker container run -dt -p 5000:5000 $IMAGE_NAME:${env.BRANCH_NAME}" + } + } + } +}