From 955bdad76de4f2ab38a4e26375d56e43ad265abe Mon Sep 17 00:00:00 2001 From: izuddin Date: Wed, 26 Aug 2026 09:36:46 +0000 Subject: [PATCH 01/27] Edit Dockerfile --- Dockerfile | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index d6ae38a..60bd236 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,14 +8,22 @@ WORKDIR /app # Salin file dependensi terlebih dahulu COPY composer.json composer.lock ./ -# Unduh/susun dependensi di stage composer (Gunakan cache/mirror lokal jika ada) -RUN composer install --no-dev --prefer-dist --no-scripts --no-autoloader --ignore-platform-reqs +# PERBAIKAN 1: Menghapus opsi ilegal '--no-autoloader' (Penyebab utama Buildah crash status 1) +# Menambahkan '--no-interaction' agar aman berjalan otomatis di dalam GitLab CI +RUN composer install \ + --no-interaction \ + --no-plugins \ + --no-scripts \ + --no-dev \ + --prefer-dist \ + --ignore-platform-reqs # Salin sisa kode aplikasi ke stage composer COPY . . -# Generate autoloader yang sudah dioptimasi -RUN composer dump-autoload --optimize --no-dev --no-plugins --no-scripts +# PERBAIKAN 2: Menghapus opsi '--no-plugins' dan '--no-scripts' dari dump-autoload +# Opsi tersebut tidak didukung oleh perintah dump-autoload pada Composer 2.x +RUN composer dump-autoload --optimize --no-dev # ========================================================= # 2. APPLICATION STAGE @@ -36,8 +44,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ WORKDIR /var/www -# Salin SELURUH source code BESERTA vendor yang sudah jadi dari stage composer -COPY --from=composer /app /var/www +# PERBAIKAN 3: Menambahkan '--chown=www-data:www-data' saat menyalin dari stage composer +# Ini wajib dilakukan agar folder aplikasi tidak terkunci sebagai milik 'root' (Pencegah Error 500) +COPY --from=composer --chown=www-data:www-data /app /var/www # Hapus proxy dari environment runtime ENV http_proxy= @@ -66,18 +75,24 @@ RUN echo 'server { \ }' > /etc/nginx/sites-available/default # Setup direktori storage & bootstrap cache Laravel serta atur izin akses +# Menambahkan pembuatan folder 'storage/logs' dan file 'laravel.log' agar writeable RUN mkdir -p \ /var/www/storage/framework/sessions \ /var/www/storage/framework/views \ /var/www/storage/framework/cache \ + /var/www/storage/logs \ /var/www/bootstrap/cache \ + && touch /var/www/storage/logs/laravel.log \ && chown -R www-data:www-data /var/www \ && chmod -R 775 /var/www/storage /var/www/bootstrap/cache +# Bersihkan sisa cache bawaan dari repo lokal agar tidak bentrok di Pod produksi +RUN php /var/www/artisan config:clear || true + ENV APP_ENV=production ENV APP_DEBUG=false ENV DB_CONNECTION=dejos EXPOSE 80 -CMD ["sh", "-c", "php-fpm -D && exec nginx -g 'daemon off;'"] \ No newline at end of file +CMD ["sh", "-c", "php-fpm -D && exec nginx -g 'daemon off;'"] From 95f15672e0b40b12882bf9f210de39cb7f9c0127 Mon Sep 17 00:00:00 2001 From: izuddin Date: Wed, 26 Aug 2026 09:41:06 +0000 Subject: [PATCH 02/27] Edit Dockerfile --- Dockerfile | 45 +++++++++++---------------------------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/Dockerfile b/Dockerfile index 60bd236..1a61c23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,32 +1,5 @@ # ========================================================= -# 1. COMPOSER STAGE (Untuk binary & vendor generation) -# ========================================================= -FROM 10.15.39.186:8084/library/composer:2.7 AS composer - -WORKDIR /app - -# Salin file dependensi terlebih dahulu -COPY composer.json composer.lock ./ - -# PERBAIKAN 1: Menghapus opsi ilegal '--no-autoloader' (Penyebab utama Buildah crash status 1) -# Menambahkan '--no-interaction' agar aman berjalan otomatis di dalam GitLab CI -RUN composer install \ - --no-interaction \ - --no-plugins \ - --no-scripts \ - --no-dev \ - --prefer-dist \ - --ignore-platform-reqs - -# Salin sisa kode aplikasi ke stage composer -COPY . . - -# PERBAIKAN 2: Menghapus opsi '--no-plugins' dan '--no-scripts' dari dump-autoload -# Opsi tersebut tidak didukung oleh perintah dump-autoload pada Composer 2.x -RUN composer dump-autoload --optimize --no-dev - -# ========================================================= -# 2. APPLICATION STAGE +# 1. APPLICATION STAGE (Single Stage untuk Lingkungan Offline) # ========================================================= FROM 10.15.39.186:8083/php74-fpm-oci8-lengkap:1.0 @@ -42,11 +15,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ unzip \ && rm -rf /var/lib/apt/lists/* +# Salin Composer binary dari registry lokal jika sewaktu-waktu butuh dump-autoload +COPY --from=10.15.39.186:8084/library/composer:2.7 /usr/bin/composer /usr/bin/composer + WORKDIR /var/www -# PERBAIKAN 3: Menambahkan '--chown=www-data:www-data' saat menyalin dari stage composer -# Ini wajib dilakukan agar folder aplikasi tidak terkunci sebagai milik 'root' (Pencegah Error 500) -COPY --from=composer --chown=www-data:www-data /app /var/www +# PERBAIKAN: Gunakan skema copy offline dari aplikasi sukses, +# tetapi tambahkan flag chown untuk mencegah error Permission Denied (Error 500) pada Pod +COPY --chown=www-data:www-data . . # Hapus proxy dari environment runtime ENV http_proxy= @@ -74,8 +50,9 @@ RUN echo 'server { \ } \ }' > /etc/nginx/sites-available/default -# Setup direktori storage & bootstrap cache Laravel serta atur izin akses -# Menambahkan pembuatan folder 'storage/logs' dan file 'laravel.log' agar writeable +# 1. Buat folder storage LENGKAP (termasuk storage/logs) +# 2. Buat file log default laravel.log +# 3. Tetapkan izin akses www-data secara menyeluruh ke root aplikasi RUN mkdir -p \ /var/www/storage/framework/sessions \ /var/www/storage/framework/views \ @@ -86,7 +63,7 @@ RUN mkdir -p \ && chown -R www-data:www-data /var/www \ && chmod -R 775 /var/www/storage /var/www/bootstrap/cache -# Bersihkan sisa cache bawaan dari repo lokal agar tidak bentrok di Pod produksi +# Bersihkan cache konfigurasi lama agar tidak menyebabkan error 500 saat pod dinyalakan RUN php /var/www/artisan config:clear || true ENV APP_ENV=production From f1a1955ce8d4fa2c6816c6ae8e7c97d62f5d69be Mon Sep 17 00:00:00 2001 From: izuddin Date: Wed, 26 Aug 2026 10:06:18 +0000 Subject: [PATCH 03/27] Edit .gitlab-ci.yml --- .gitlab-ci.yml | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5b3095d..dbe7eb3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,8 +14,8 @@ variables: https_proxy: "http://10.15.3.20:80" HTTP_PROXY: "http://10.15.3.20:80" HTTPS_PROXY: "http://10.15.3.20:80" - no_proxy: "127.0.0.1,localhost,10.15.39.186,10.15.39.0/24,10.42.0.0/16,10.43.0.0/16,.jakarta.go.id" - NO_PROXY: "127.0.0.1,localhost,10.15.39.186,10.15.39.0/24,10.42.0.0/16,10.43.0.0/16,.jakarta.go.id" + no_proxy: "127.0.0.1,localhost,10.15.39.168,10.15.39.186,10.15.39.0/24,10.42.0.0/16,10.43.0.0/16,.jakarta.go.id" + NO_PROXY: "127.0.0.1,localhost,10.15.39.168,10.15.39.186,10.15.39.0/24,10.42.0.0/16,10.43.0.0/16,.jakarta.go.id" # ========================================================= # BUILD IMAGE VIA BUILDAH @@ -72,61 +72,69 @@ deploy: - export no_proxy="*" - mkdir -p ./kubeconfig-dir - echo "$KUBECONFIG_B64" | base64 -d > ./kubeconfig-dir/config + - sed -i 's|127.0.0.1|10.15.39.168|g' ./kubeconfig-dir/config - chmod 600 ./kubeconfig-dir/config - export KUBECONFIG=$(pwd)/kubeconfig-dir/config - echo '2. TEST CONNECTION TO RKE2' - - kubectl version --client - - kubectl get nodes - - kubectl create namespace $KUBE_NAMESPACE --dry-run=client -o yaml | kubectl apply -f - + - kubectl version --client --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true + - kubectl get nodes --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true + - kubectl create namespace $KUBE_NAMESPACE --dry-run=client -o yaml | kubectl apply -f - --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true - echo '3. VALIDASI TEMPLATE HELM (DEBUG)' - helm template $HELM_RELEASE ./helm/sidata --namespace $KUBE_NAMESPACE --debug + - echo '3.5. CLEAN UNMANAGED SERVICE JIKA BENTROK' + # Menghapus service non-helm (hasil manual kubectl expose tadi) agar peluncuran Helm bersih + - kubectl delete service sidata-service -n $KUBE_NAMESPACE --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true || true + - echo '4. DEPLOYING APPS VIA HELM' - | helm upgrade --install $HELM_RELEASE ./helm/sidata \ + --kube-apiserver https://10.15.39.168:6443 \ + --kube-insecure-skip-tls-verify \ --namespace $KUBE_NAMESPACE \ + --force \ --set image.repository=$IMAGE \ --set image.tag=$TAG \ --set-string podAnnotations.rolloutTimestamp="$(date +%s)" \ --set service.type=NodePort \ - --set service.nodePort=32180 \ + --set service.nodePort=32185 \ + --set service.name=sidata-service \ --set-string extraEnv.APP_ENV="production" \ --set-string extraEnv.APP_DEBUG="false" \ --set-string extraEnv.FORCE_HTTPS="true" \ --set-string extraEnv.APP_KEY="base64:HiyJqrnWz8zB6WUCXTVb6lZsC3EraX/vFIn66Hx/dVM=" \ - --set-string extraEnv.APP_URL="https://dashboard-bpkd.drc-bpkd.data-center.id/skpp" \ - --set-string extraEnv.ASSET_URL="https://dashboard-bpkd.drc-bpkd.data-center.id/skpp" \ + --set-string extraEnv.APP_URL="https://data-center.id" \ + --set-string extraEnv.ASSET_URL="https://data-center.id" \ --set-string extraEnv.SESSION_DRIVER="file" \ --set-string extraEnv.SESSION_SECURE_COOKIE="true" - echo '5. CHECK REAL NODEPORT STATUS' - - kubectl get svc -n $KUBE_NAMESPACE + - kubectl get svc -n $KUBE_NAMESPACE --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true - echo '6. CHECK STATUS ROLLOUT' - - kubectl rollout status deployment/$HELM_RELEASE -n $KUBE_NAMESPACE --timeout=180s || kubectl rollout status deployment/$HELM_RELEASE-skpp -n $KUBE_NAMESPACE --timeout=180s + - kubectl rollout status deployment/$HELM_RELEASE -n $KUBE_NAMESPACE --timeout=180s --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true || kubectl rollout status deployment/$HELM_RELEASE-sidata -n $KUBE_NAMESPACE --timeout=180s --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true - echo '7. AUTO CLEAR LARAVEL CACHE ON POD' - | - # Berikan jeda 5 detik agar pod baru benar-benar stabil sebelum dieksekusi artisan commands sleep 5 - POD_NAME=$(kubectl get pods -n $KUBE_NAMESPACE -l app=$HELM_RELEASE --field-selector=status.phase=Running -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || true) + POD_NAME=$(kubectl get pods -n $KUBE_NAMESPACE -l app=$HELM_RELEASE --field-selector=status.phase=Running --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || true) if [ -z "$POD_NAME" ]; then - POD_NAME=$(kubectl get pods -n $KUBE_NAMESPACE -l app.kubernetes.io/instance=$HELM_RELEASE --field-selector=status.phase=Running -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || true) + POD_NAME=$(kubectl get pods -n $KUBE_NAMESPACE -l app.kubernetes.io/instance=$HELM_RELEASE --field-selector=status.phase=Running --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || true) fi if [ -n "$POD_NAME" ]; then echo "Executing Artisan Clear Cache on Pod: $POD_NAME" - kubectl exec -n $KUBE_NAMESPACE $POD_NAME -- php artisan config:clear || true - kubectl exec -n $KUBE_NAMESPACE $POD_NAME -- php artisan route:clear || true - kubectl exec -n $KUBE_NAMESPACE $POD_NAME -- php artisan cache:clear || true - kubectl exec -n $KUBE_NAMESPACE $POD_NAME -- php artisan view:clear || true + kubectl exec -n $KUBE_NAMESPACE $POD_NAME --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true -- php artisan config:clear || true + kubectl exec -n $KUBE_NAMESPACE $POD_NAME --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true -- php artisan route:clear || true + kubectl exec -n $KUBE_NAMESPACE $POD_NAME --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true -- php artisan cache:clear || true + kubectl exec -n $KUBE_NAMESPACE $POD_NAME --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true -- php artisan view:clear || true else echo "Warning: No running pod found for Artisan commands execution, skipping." fi after_script: - echo "Cleaning up sensitive temporary files..." - - rm -rf ./kubeconfig-dir \ No newline at end of file + - rm -rf ./kubeconfig-dir From e3cc7ceea23f82b8f176aeb558988d43245f9e1b Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 01:49:24 +0000 Subject: [PATCH 04/27] Edit deployment.yaml --- helm/sidata/templates/deployment.yaml | 40 --------------------------- 1 file changed, 40 deletions(-) diff --git a/helm/sidata/templates/deployment.yaml b/helm/sidata/templates/deployment.yaml index 3da71ad..98e73da 100644 --- a/helm/sidata/templates/deployment.yaml +++ b/helm/sidata/templates/deployment.yaml @@ -24,46 +24,6 @@ spec: - name: nginx-config-volume mountPath: /etc/nginx/http.d/default.conf subPath: default.conf - env: - {{- if .Values.env }} - {{- range $key, $value := .Values.env }} - - name: {{ $key }} - value: {{ $value | quote }} - {{- end }} - {{- end }} - # --- KONFIGURASI UTAMA SUB-PATH & REVERSE PROXY LARAVEL --- - - name: APP_URL - value: "https://dashboard-bpkd.drc-bpkd.data-center.id/sidata" - - name: ASSET_URL - value: "https://dashboard-bpkd.drc-bpkd.data-center.id/sidata" - - name: SESSION_DRIVER - value: "file" - - name: SESSION_DOMAIN - value: "" - - name: SESSION_PATH - value: "/" - - name: SESSION_SECURE_COOKIE - value: "false" - - name: SESSION_SAME_SITE - value: "lax" - - name: TRUSTED_PROXIES - value: "*" - # --- SECRETS --- - - name: APP_KEY - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-secret - key: APP_KEY - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-secret - key: DB_PASSWORD - - name: ORA_PASSWORD - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-secret - key: ORA_PASSWORD volumes: - name: nginx-config-volume configMap: From fd948e1f2c2b5e294b7e6e02531bc75cdcc7a72f Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 01:52:37 +0000 Subject: [PATCH 05/27] Edit deployment.yaml --- helm/sidata/templates/deployment.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/helm/sidata/templates/deployment.yaml b/helm/sidata/templates/deployment.yaml index 98e73da..a8e7b00 100644 --- a/helm/sidata/templates/deployment.yaml +++ b/helm/sidata/templates/deployment.yaml @@ -24,6 +24,11 @@ spec: - name: nginx-config-volume mountPath: /etc/nginx/http.d/default.conf subPath: default.conf + env: + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} volumes: - name: nginx-config-volume configMap: From c1120e9f5f458ff4801f5c95fc1234f4b5ca843d Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 02:14:30 +0000 Subject: [PATCH 06/27] Edit Dockerfile --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 1a61c23..c13010d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,8 @@ COPY --from=10.15.39.186:8084/library/composer:2.7 /usr/bin/composer /usr/bin/co WORKDIR /var/www +RUN composer i + # PERBAIKAN: Gunakan skema copy offline dari aplikasi sukses, # tetapi tambahkan flag chown untuk mencegah error Permission Denied (Error 500) pada Pod COPY --chown=www-data:www-data . . From d689619d4c116febda6963f2ec53080c1c1d9de0 Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 02:28:27 +0000 Subject: [PATCH 07/27] Edit Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c13010d..4e6488d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,12 +20,12 @@ COPY --from=10.15.39.186:8084/library/composer:2.7 /usr/bin/composer /usr/bin/co WORKDIR /var/www -RUN composer i - # PERBAIKAN: Gunakan skema copy offline dari aplikasi sukses, # tetapi tambahkan flag chown untuk mencegah error Permission Denied (Error 500) pada Pod COPY --chown=www-data:www-data . . +RUN composer i + # Hapus proxy dari environment runtime ENV http_proxy= ENV https_proxy= From 0798a4f5df9a6b739302c145cf74d08f2e2acff1 Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 03:18:52 +0000 Subject: [PATCH 08/27] Edit Dockerfile --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4e6488d..4a62da0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,11 @@ WORKDIR /var/www # tetapi tambahkan flag chown untuk mencegah error Permission Denied (Error 500) pada Pod COPY --chown=www-data:www-data . . -RUN composer i +RUN composer install \ + --no-dev \ + --no-scripts \ + --no-autoloader \ + --no-interaction # Hapus proxy dari environment runtime ENV http_proxy= From fbf54f9f4ba019123a17fc9460536d6fb5fa6b9c Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 03:37:29 +0000 Subject: [PATCH 09/27] Edit Dockerfile --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4a62da0..d9c25e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ ENV https_proxy=$https_proxy # Install Nginx & Dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ + vim \ nginx \ unzip \ && rm -rf /var/lib/apt/lists/* @@ -31,8 +32,8 @@ RUN composer install \ --no-interaction # Hapus proxy dari environment runtime -ENV http_proxy= -ENV https_proxy= +#ENV http_proxy= +#ENV https_proxy= # Setup Nginx Config RUN echo 'server { \ From ca36be56d9d999065166c4caf92cceca9ed97889 Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 03:37:48 +0000 Subject: [PATCH 10/27] Edit values.yaml --- helm/sidata/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/sidata/values.yaml b/helm/sidata/values.yaml index 46d6d7f..206e062 100644 --- a/helm/sidata/values.yaml +++ b/helm/sidata/values.yaml @@ -8,7 +8,7 @@ image: service: type: NodePort port: 80 - targetPort: 9000 + targetPort: 80 nodePort: 32180 ingress: From 8a862b4cd72cc372427ec0744b9881f9d3623caa Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 03:38:50 +0000 Subject: [PATCH 11/27] Edit deployment.yaml --- helm/sidata/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/sidata/templates/deployment.yaml b/helm/sidata/templates/deployment.yaml index a8e7b00..fb50dbd 100644 --- a/helm/sidata/templates/deployment.yaml +++ b/helm/sidata/templates/deployment.yaml @@ -19,7 +19,7 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy | default "Always" }} ports: - - containerPort: {{ .Values.service.targetPort | default 80 }} + - containerPort: 80 volumeMounts: - name: nginx-config-volume mountPath: /etc/nginx/http.d/default.conf From 7f091301f55b8e7a61fd4465829d5a284aba6dd2 Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 03:50:11 +0000 Subject: [PATCH 12/27] Edit Dockerfile --- Dockerfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index d9c25e2..367f255 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,11 +25,7 @@ WORKDIR /var/www # tetapi tambahkan flag chown untuk mencegah error Permission Denied (Error 500) pada Pod COPY --chown=www-data:www-data . . -RUN composer install \ - --no-dev \ - --no-scripts \ - --no-autoloader \ - --no-interaction +RUN composer install # Hapus proxy dari environment runtime #ENV http_proxy= From 92c1abc8f01796af74977e79e72fc107ead63360 Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 04:03:53 +0000 Subject: [PATCH 13/27] Edit Dockerfile --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 367f255..a6fa840 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,11 @@ WORKDIR /var/www # tetapi tambahkan flag chown untuk mencegah error Permission Denied (Error 500) pada Pod COPY --chown=www-data:www-data . . -RUN composer install +RUN composer install \ + --no-dev \ + --prefer-dist \ + --no-interaction \ + --optimize-autoloader # Hapus proxy dari environment runtime #ENV http_proxy= From ae770aba33c1594ea8a2b59eee8bab5adc5213bb Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 04:20:01 +0000 Subject: [PATCH 14/27] Edit Dockerfile --- Dockerfile | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index a6fa840..50d96cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,15 +9,34 @@ ARG https_proxy ENV http_proxy=$http_proxy ENV https_proxy=$https_proxy -# Install Nginx & Dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN apt-get update && apt-get install -y \ vim \ - nginx \ - unzip \ - && rm -rf /var/lib/apt/lists/* + alien \ + wget \ + libpng-dev \ + libjpeg-dev \ + libfreetype6-dev \ + libzip-dev \ + libaio1 \ + libaio-dev \ + zip \ + git \ + && docker-php-ext-configure gd --with-freetype --with-jpeg \ + && docker-php-ext-install gd pdo pdo_mysql zip -# Salin Composer binary dari registry lokal jika sewaktu-waktu butuh dump-autoload -COPY --from=10.15.39.186:8084/library/composer:2.7 /usr/bin/composer /usr/bin/composer +RUN wget https://download.oracle.com/otn_software/linux/instantclient/1919000/oracle-instantclient19.19-basic-19.19.0.0.0-1.el9.x86_64.rpm && \ + wget https://download.oracle.com/otn_software/linux/instantclient/1919000/oracle-instantclient19.19-devel-19.19.0.0.0-1.el9.x86_64.rpm && \ + alien -i oracle-instantclient19.19-*.rpm && \ + rm oracle-instantclient19.19-*.rpm + +RUN pear config-set http_proxy "http://10.15.3.20:80" && export PHP_DTRACE=yes + +# Install ekstensi OCI8 +RUN pecl channel-update pecl.php.net && C_INCLUDE_PATH=/usr/include/oracle/19.19/client64 pecl install oci8-2.2.0 && \ + echo "extension=oci8.so" > /usr/local/etc/php/conf.d/oci8.ini + +# Install Composer +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer WORKDIR /var/www @@ -25,11 +44,7 @@ WORKDIR /var/www # tetapi tambahkan flag chown untuk mencegah error Permission Denied (Error 500) pada Pod COPY --chown=www-data:www-data . . -RUN composer install \ - --no-dev \ - --prefer-dist \ - --no-interaction \ - --optimize-autoloader +RUN composer install # Hapus proxy dari environment runtime #ENV http_proxy= @@ -73,10 +88,6 @@ RUN mkdir -p \ # Bersihkan cache konfigurasi lama agar tidak menyebabkan error 500 saat pod dinyalakan RUN php /var/www/artisan config:clear || true -ENV APP_ENV=production -ENV APP_DEBUG=false -ENV DB_CONNECTION=dejos - EXPOSE 80 CMD ["sh", "-c", "php-fpm -D && exec nginx -g 'daemon off;'"] From c0ab14bd08de61244d4f8f81874ea9cc49bf273b Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 04:40:56 +0000 Subject: [PATCH 15/27] Edit Dockerfile --- Dockerfile | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 50d96cb..a267aba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ # 1. APPLICATION STAGE (Single Stage untuk Lingkungan Offline) # ========================================================= FROM 10.15.39.186:8083/php74-fpm-oci8-lengkap:1.0 +FROM 10.15.39.186:8084/library/php:7.4-fpm ARG http_proxy ARG https_proxy @@ -11,7 +12,6 @@ ENV https_proxy=$https_proxy RUN apt-get update && apt-get install -y \ vim \ - alien \ wget \ libpng-dev \ libjpeg-dev \ @@ -24,17 +24,8 @@ RUN apt-get update && apt-get install -y \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-install gd pdo pdo_mysql zip -RUN wget https://download.oracle.com/otn_software/linux/instantclient/1919000/oracle-instantclient19.19-basic-19.19.0.0.0-1.el9.x86_64.rpm && \ - wget https://download.oracle.com/otn_software/linux/instantclient/1919000/oracle-instantclient19.19-devel-19.19.0.0.0-1.el9.x86_64.rpm && \ - alien -i oracle-instantclient19.19-*.rpm && \ - rm oracle-instantclient19.19-*.rpm - RUN pear config-set http_proxy "http://10.15.3.20:80" && export PHP_DTRACE=yes -# Install ekstensi OCI8 -RUN pecl channel-update pecl.php.net && C_INCLUDE_PATH=/usr/include/oracle/19.19/client64 pecl install oci8-2.2.0 && \ - echo "extension=oci8.so" > /usr/local/etc/php/conf.d/oci8.ini - # Install Composer COPY --from=composer:latest /usr/bin/composer /usr/bin/composer From 5c13dd42fee95a072cf00926868ed95dce300451 Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 05:50:58 +0000 Subject: [PATCH 16/27] Edit Dockerfile --- Dockerfile | 166 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 122 insertions(+), 44 deletions(-) diff --git a/Dockerfile b/Dockerfile index a267aba..d897684 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,28 @@ # ========================================================= -# 1. APPLICATION STAGE (Single Stage untuk Lingkungan Offline) +# APPLICATION STAGE +# Laravel + PHP 7.4 + OCI8 + Nginx # ========================================================= + FROM 10.15.39.186:8083/php74-fpm-oci8-lengkap:1.0 -FROM 10.15.39.186:8084/library/php:7.4-fpm + +# ========================================================= +# Proxy +# ========================================================= ARG http_proxy ARG https_proxy -ENV http_proxy=$http_proxy -ENV https_proxy=$https_proxy +ENV http_proxy=${http_proxy} +ENV https_proxy=${https_proxy} +ENV HTTP_PROXY=${http_proxy} +ENV HTTPS_PROXY=${https_proxy} + +# ========================================================= +# System dependencies +# ========================================================= RUN apt-get update && apt-get install -y \ + nginx \ vim \ wget \ libpng-dev \ @@ -21,51 +33,54 @@ RUN apt-get update && apt-get install -y \ libaio-dev \ zip \ git \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install gd pdo pdo_mysql zip + unzip \ + && docker-php-ext-configure gd \ + --with-freetype \ + --with-jpeg \ + && docker-php-ext-install \ + gd \ + pdo \ + pdo_mysql \ + zip \ + && rm -rf /var/lib/apt/lists/* -RUN pear config-set http_proxy "http://10.15.3.20:80" && export PHP_DTRACE=yes +# ========================================================= +# PEAR Proxy +# ========================================================= -# Install Composer -COPY --from=composer:latest /usr/bin/composer /usr/bin/composer +RUN pear config-set http_proxy "http://10.15.3.20:80" + +# ========================================================= +# Composer +# ========================================================= + +COPY --from=composer:2.2 /usr/bin/composer /usr/bin/composer WORKDIR /var/www -# PERBAIKAN: Gunakan skema copy offline dari aplikasi sukses, -# tetapi tambahkan flag chown untuk mencegah error Permission Denied (Error 500) pada Pod +# ========================================================= +# Composer dependency +# Copy hanya composer files terlebih dahulu agar Docker cache +# ========================================================= + +COPY composer.json composer.lock ./ + +RUN composer install \ + --no-dev \ + --prefer-dist \ + --no-interaction \ + --optimize-autoloader + +# ========================================================= +# Application +# ========================================================= + COPY --chown=www-data:www-data . . -RUN composer install +# ========================================================= +# Laravel directories & permission +# ========================================================= -# Hapus proxy dari environment runtime -#ENV http_proxy= -#ENV https_proxy= - -# Setup Nginx Config -RUN echo 'server { \ - listen 80; \ - index index.php index.html; \ - error_log /var/log/nginx/error.log; \ - access_log /var/log/nginx/access.log; \ - root /var/www/public; \ - location ~ \.php$ { \ - try_files $uri =404; \ - fastcgi_split_path_info ^(.+\.php)(/.+)$; \ - fastcgi_pass 127.0.0.1:9000; \ - fastcgi_index index.php; \ - include fastcgi_params; \ - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; \ - fastcgi_param PATH_INFO $fastcgi_path_info; \ - } \ - location / { \ - try_files $uri $uri/ /index.php?$query_string; \ - gzip_static on; \ - } \ -}' > /etc/nginx/sites-available/default - -# 1. Buat folder storage LENGKAP (termasuk storage/logs) -# 2. Buat file log default laravel.log -# 3. Tetapkan izin akses www-data secara menyeluruh ke root aplikasi RUN mkdir -p \ /var/www/storage/framework/sessions \ /var/www/storage/framework/views \ @@ -74,11 +89,74 @@ RUN mkdir -p \ /var/www/bootstrap/cache \ && touch /var/www/storage/logs/laravel.log \ && chown -R www-data:www-data /var/www \ - && chmod -R 775 /var/www/storage /var/www/bootstrap/cache + && chmod -R 775 /var/www/storage \ + && chmod -R 775 /var/www/bootstrap/cache -# Bersihkan cache konfigurasi lama agar tidak menyebabkan error 500 saat pod dinyalakan -RUN php /var/www/artisan config:clear || true +# ========================================================= +# Laravel cache +# ========================================================= + +RUN php artisan config:clear || true \ + && php artisan cache:clear || true \ + && php artisan view:clear || true + +# ========================================================= +# Nginx configuration +# ========================================================= + +RUN rm -f /etc/nginx/sites-enabled/default \ + && rm -f /etc/nginx/sites-available/default + +RUN printf '%s\n' \ +'server {' \ +' listen 80;' \ +' server_name _;' \ +'' \ +' root /var/www/public;' \ +' index index.php index.html;' \ +'' \ +' access_log /var/log/nginx/access.log;' \ +' error_log /var/log/nginx/error.log;' \ +'' \ +' location / {' \ +' try_files $uri $uri/ /index.php?$query_string;' \ +' }' \ +'' \ +' location ~ \.php$ {' \ +' try_files $uri =404;' \ +' include fastcgi_params;' \ +' fastcgi_pass 127.0.0.1:9000;' \ +' fastcgi_index index.php;' \ +' fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;' \ +' fastcgi_param PATH_INFO $fastcgi_path_info;' \ +' }' \ +'' \ +' location ~ /\.ht {' \ +' deny all;' \ +' }' \ +'}' \ +> /etc/nginx/sites-available/default + +RUN ln -sf /etc/nginx/sites-available/default \ + /etc/nginx/sites-enabled/default + +# ========================================================= +# Remove proxy from runtime +# ========================================================= + +ENV http_proxy="" +ENV https_proxy="" +ENV HTTP_PROXY="" +ENV HTTPS_PROXY="" + +# ========================================================= +# Port +# ========================================================= EXPOSE 80 +# ========================================================= +# Start PHP-FPM + Nginx +# ========================================================= + CMD ["sh", "-c", "php-fpm -D && exec nginx -g 'daemon off;'"] From f7c38b89aa2798964ccf7851949d767f6299131f Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 05:57:50 +0000 Subject: [PATCH 17/27] Edit Dockerfile --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d897684..3437e7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,8 +54,6 @@ RUN pear config-set http_proxy "http://10.15.3.20:80" # Composer # ========================================================= -COPY --from=composer:2.2 /usr/bin/composer /usr/bin/composer - WORKDIR /var/www # ========================================================= From 993a10b27665657e5868e37256a8906a4df4fc0a Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 06:05:54 +0000 Subject: [PATCH 18/27] Edit Dockerfile --- Dockerfile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3437e7d..e567727 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,18 +63,14 @@ WORKDIR /var/www COPY composer.json composer.lock ./ +COPY --chown=www-data:www-data . . + RUN composer install \ --no-dev \ --prefer-dist \ --no-interaction \ --optimize-autoloader -# ========================================================= -# Application -# ========================================================= - -COPY --chown=www-data:www-data . . - # ========================================================= # Laravel directories & permission # ========================================================= From a98792a4e6bc81825a51b6ce23d1b05e7a2ad1d5 Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 06:17:13 +0000 Subject: [PATCH 19/27] Edit values.yaml --- helm/sidata/values.yaml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/helm/sidata/values.yaml b/helm/sidata/values.yaml index 206e062..67357b3 100644 --- a/helm/sidata/values.yaml +++ b/helm/sidata/values.yaml @@ -31,12 +31,21 @@ env: APP_URL: "https://dashboard-bpkd.drc-bpkd.data-center.id/sidata" ASSET_URL: "https://dashboard-bpkd.drc-bpkd.data-center.id/sidata" FORCE_HTTPS: "true" - DB_CONNECTION: "mysql" - DB_HOST: "10.15.39.185" - DB_PORT: "3306" - DB_DATABASE: "sidata" - DB_USERNAME: "aplikasi" + DB_CONNECTION: "Samasa" + DB_HOST: "10.15.39.193" + DB_PORT: "1521" + DB_DATABASE: "SAMASA" + DB_USERNAME: "samasa" + DB_PASSWORD: "123samasa" + DB_SERVICENAME: "sipkd.localdomain" + + ORA_CONNECTION: "oracle" ORA_HOST: "10.15.39.193" + ORA_PORT: "1521" + ORA_DATABASE: "NEWSIPKD" + ORA_USERNAME: "proksi" + ORA_PASSWORD: "123456" + ORA_SERVICENAME: "sipkd.localdomain" # Rahasia Sensitive secrets: From cb0b0c637ac41ddb38ac7ec757515dd8138d2bca Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 06:24:52 +0000 Subject: [PATCH 20/27] Edit values.yaml --- helm/sidata/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helm/sidata/values.yaml b/helm/sidata/values.yaml index 67357b3..2f2cf30 100644 --- a/helm/sidata/values.yaml +++ b/helm/sidata/values.yaml @@ -50,5 +50,5 @@ env: # Rahasia Sensitive secrets: APP_KEY: "base64:HiyJqrnWz8zB6WUCXTVb6lZsC3EraX/vFIn66Hx/dVM=" - DB_PASSWORD: "pusdatin" - ORA_PASSWORD: "123456" \ No newline at end of file + #DB_PASSWORD: "pusdatin" + #ORA_PASSWORD: "123456" \ No newline at end of file From afc6cfb331a036f98c8d36668b848c4e07749b42 Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 06:35:20 +0000 Subject: [PATCH 21/27] Edit Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index e567727..9ad4738 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,6 +69,7 @@ RUN composer install \ --no-dev \ --prefer-dist \ --no-interaction \ + --no-scripts \ --optimize-autoloader # ========================================================= From 31c69170f8b913ef5132c5ad686adbb0a0f24ed2 Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 07:33:21 +0000 Subject: [PATCH 22/27] Edit secret.yaml --- helm/sidata/templates/secret.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helm/sidata/templates/secret.yaml b/helm/sidata/templates/secret.yaml index ce7cd8f..4d968b5 100644 --- a/helm/sidata/templates/secret.yaml +++ b/helm/sidata/templates/secret.yaml @@ -5,5 +5,5 @@ metadata: type: Opaque stringData: APP_KEY: {{ .Values.secrets.APP_KEY | quote }} - DB_PASSWORD: {{ .Values.secrets.DB_PASSWORD | quote }} - ORA_PASSWORD: {{ .Values.secrets.ORA_PASSWORD | quote }} \ No newline at end of file + #DB_PASSWORD: {{ .Values.secrets.DB_PASSWORD | quote }} + #ORA_PASSWORD: {{ .Values.secrets.ORA_PASSWORD | quote }} \ No newline at end of file From 658e18d051e3d4612e4ce8e057098621fe5fa56b Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 07:47:09 +0000 Subject: [PATCH 23/27] Edit secret.yaml --- helm/sidata/templates/secret.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/helm/sidata/templates/secret.yaml b/helm/sidata/templates/secret.yaml index 4d968b5..787c4ad 100644 --- a/helm/sidata/templates/secret.yaml +++ b/helm/sidata/templates/secret.yaml @@ -4,6 +4,4 @@ metadata: name: {{ .Release.Name }}-secret type: Opaque stringData: - APP_KEY: {{ .Values.secrets.APP_KEY | quote }} - #DB_PASSWORD: {{ .Values.secrets.DB_PASSWORD | quote }} - #ORA_PASSWORD: {{ .Values.secrets.ORA_PASSWORD | quote }} \ No newline at end of file + APP_KEY: {{ .Values.secrets.APP_KEY | quote }} \ No newline at end of file From ada9a8be8c2b60b07e4b115d7ab1c767c0bf9ab1 Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 07:47:52 +0000 Subject: [PATCH 24/27] Edit values.yaml --- helm/sidata/values.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/helm/sidata/values.yaml b/helm/sidata/values.yaml index 2f2cf30..f957b14 100644 --- a/helm/sidata/values.yaml +++ b/helm/sidata/values.yaml @@ -49,6 +49,4 @@ env: # Rahasia Sensitive secrets: - APP_KEY: "base64:HiyJqrnWz8zB6WUCXTVb6lZsC3EraX/vFIn66Hx/dVM=" - #DB_PASSWORD: "pusdatin" - #ORA_PASSWORD: "123456" \ No newline at end of file + APP_KEY: "base64:HiyJqrnWz8zB6WUCXTVb6lZsC3EraX/vFIn66Hx/dVM=" \ No newline at end of file From 158faba19fb25e52b73871140d0a6235a95e5e82 Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 07:52:55 +0000 Subject: [PATCH 25/27] Edit deployment.yaml --- helm/sidata/templates/deployment.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/helm/sidata/templates/deployment.yaml b/helm/sidata/templates/deployment.yaml index fb50dbd..cc94d52 100644 --- a/helm/sidata/templates/deployment.yaml +++ b/helm/sidata/templates/deployment.yaml @@ -29,6 +29,12 @@ spec: - name: {{ $key }} value: {{ $value | quote }} {{- end }} + + - name: APP_KEY + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-secret + key: APP_KEY volumes: - name: nginx-config-volume configMap: From 52738325b208bcfe52eb8fcbf297f0d0df060145 Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 08:10:35 +0000 Subject: [PATCH 26/27] Edit deployment.yaml --- helm/sidata/templates/deployment.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helm/sidata/templates/deployment.yaml b/helm/sidata/templates/deployment.yaml index cc94d52..df5163a 100644 --- a/helm/sidata/templates/deployment.yaml +++ b/helm/sidata/templates/deployment.yaml @@ -32,9 +32,9 @@ spec: - name: APP_KEY valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-secret - key: APP_KEY + secretKeyRef: + name: {{ .Release.Name }}-secret + key: APP_KEY volumes: - name: nginx-config-volume configMap: From 3d37694684146507b44d526cb0ae5e7c30c763a8 Mon Sep 17 00:00:00 2001 From: izuddin Date: Thu, 27 Aug 2026 08:19:46 +0000 Subject: [PATCH 27/27] Edit deployment.yaml --- helm/sidata/templates/deployment.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/helm/sidata/templates/deployment.yaml b/helm/sidata/templates/deployment.yaml index df5163a..e373971 100644 --- a/helm/sidata/templates/deployment.yaml +++ b/helm/sidata/templates/deployment.yaml @@ -30,11 +30,11 @@ spec: value: {{ $value | quote }} {{- end }} - - name: APP_KEY - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-secret - key: APP_KEY + - name: APP_KEY + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-secret + key: APP_KEY volumes: - name: nginx-config-volume configMap: