From 28fb15aa12c962c424f35c5cca56780005ddde0d Mon Sep 17 00:00:00 2001 From: root Date: Sun, 27 Apr 2025 09:41:47 +0700 Subject: [PATCH] Update Dockerfile and Jenkinsfile for CI/CD pipeline --- Dockerfile | 17 +++++++++++++++++ Jenkinsfile | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..984948a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +# Base image dari docker registry lokal +FROM docker.rri.co.id/php74-fpm:latest + +# Install PHP extension tambahan yang dibutuhkan CI3 +RUN docker-php-ext-install mysqli pdo pdo_mysql + +# Copy source code aplikasi ke container +COPY . /var/www/website_csirt + +# Set permission yang benar +RUN chown -R www-data:www-data /var/www/website_csirt + +# Expose port PHP-FPM +EXPOSE 9000 + +# Jalankan PHP-FPM +CMD ["php-fpm"] diff --git a/Jenkinsfile b/Jenkinsfile index bd328d1..859d765 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,7 @@ pipeline { sh "docker build -t ${REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG} ." } } - stage('Push Image') { + stage('Push Docker Image') { steps { withCredentials([usernamePassword(credentialsId: 'docker-credentials', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS')]) { sh """