Update Dockerfile and Jenkinsfile for CI/CD pipeline

This commit is contained in:
root 2025-04-27 09:41:47 +07:00
parent f52a9ef4df
commit 28fb15aa12
2 changed files with 18 additions and 1 deletions

17
Dockerfile Normal file
View File

@ -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"]

2
Jenkinsfile vendored
View File

@ -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 """