commit 7afe6a20ddc653da4655d67dd8e8c7c0931a0fd8 Author: admin Date: Wed Dec 31 19:20:52 2025 +0700 Initial commit: Hello Devops CI/CD diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7102eda --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM nginx:alpine + +COPY index.html /usr/share/nginx/html/index.html + diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..b39a4b1 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,22 @@ +pipeline { + agent any + + stages { + stage('Build Docker Image') { + steps { + sh 'docker build -t hello-devops .' + } + } + + stage('Deploy Container') { + steps { + sh ''' + docker stop hello-devops || true + docker rm hello-devops || true + docker run -d --name hello-devops -p 5000:80 hello-devops + ''' + } + } + } +} + diff --git a/index.html b/index.html new file mode 100644 index 0000000..6f7307c --- /dev/null +++ b/index.html @@ -0,0 +1,9 @@ + + + + DevOps Demo + + +

Hello World

+ +