Update Dockerfile and Jenkinsfile for CI/CD pipeline
This commit is contained in:
parent
f52a9ef4df
commit
28fb15aa12
17
Dockerfile
Normal file
17
Dockerfile
Normal 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
2
Jenkinsfile
vendored
@ -20,7 +20,7 @@ pipeline {
|
|||||||
sh "docker build -t ${REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG} ."
|
sh "docker build -t ${REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG} ."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Push Image') {
|
stage('Push Docker Image') {
|
||||||
steps {
|
steps {
|
||||||
withCredentials([usernamePassword(credentialsId: 'docker-credentials', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS')]) {
|
withCredentials([usernamePassword(credentialsId: 'docker-credentials', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS')]) {
|
||||||
sh """
|
sh """
|
||||||
|
Loading…
x
Reference in New Issue
Block a user