32 Commits
Author SHA1 Message Date
gitea d668e3023d ci: fix workflow steps indentation
CI/CD Pipeline to Rancher - SIDATA / build-and-deploy (push) Successful in 13s
2026-09-07 14:42:19 +07:00
gitea 08275d264c ci: fix workflow indentation 2026-09-07 14:40:41 +07:00
gitea c776bc3570 ci: trigger SIDATA workflow 2026-09-07 14:38:28 +07:00
gitea d23d700500 fix: update SIDATA CI/CD workflow 2026-09-07 14:36:53 +07:00
gitea 116c6e300b chore: remove test secrets workflow 2026-09-07 14:32:51 +07:00
gitea 9d00fd34c4 ci: trigger runner 2026-09-07 14:29:10 +07:00
gitea 4baa270b6b fix: update Gitea CI/CD Nexus and Rancher2 2026-09-07 14:27:18 +07:00
gitea c1b6a2ae9c fix: configure Nexus registry and Rancher deployment
Test Secrets / test (push) Successful in 14s
2026-09-07 14:22:45 +07:00
gitea 132d8efbc6 test gitea secrets
Test Secrets / test (push) Successful in 13s
2026-09-07 14:21:43 +07:00
gitea 11b5583c86 fix: update Gitea CI/CD Nexus build and Rancher deploy 2026-09-07 14:18:48 +07:00
gitea 89b16d48b6 fix: use Nexus registry for SIDATA 2026-09-07 14:14:59 +07:00
gitea 29785df970 fix: use Nexus for CI/CD build 2026-09-07 14:12:58 +07:00
gitea 894ba4c124 fix: update CI/CD deployment
CI/CD SIDATA - Rancher / build-and-deploy (push) Failing after 33s
2026-09-07 13:59:12 +07:00
gitea a045c29c39 Fix Gitea CI/CD deployment
CI/CD Pipeline to Rancher - SIDATA / build-and-deploy (push) Failing after 29s
2026-09-07 13:50:22 +07:00
gitea 3ba17295b7 Fix CI/CD deployment SIDATA 2026-09-07 13:42:09 +07:00
gitea 3ed5d62bda fix: update CI/CD pipeline
CI/CD Pipeline to Rancher - SIDATA / build-and-deploy (push) Failing after 42s
2026-09-07 13:31:39 +07:00
gitea c8be35b1de Fix BuildKit network for internal Nexus registry
CI/CD Pipeline to Rancher - SIDATA / build-and-deploy (push) Failing after 22s
2026-09-07 13:28:55 +07:00
gitea 97192cf923 Fix Gitea Docker build and Rancher deployment
CI/CD Pipeline to Rancher - SIDATA / build-and-deploy (push) Failing after 1m1s
2026-09-07 13:20:47 +07:00
gitea 137658a99b Fix Docker build proxy and Gitea deployment
CI/CD Pipeline to Rancher - SIDATA / build-and-deploy (push) Failing after 4m19s
2026-09-07 11:58:49 +07:00
gitea 341faec48b ci: trigger build 2026-09-06 16:13:12 +07:00
gitea 077c9a6253 test: trigger action
CI/CD Pipeline to Rancher - SIDATA / build-and-deploy (push) Failing after 3m14s
2026-09-06 15:57:45 +07:00
gitea 811f9ee741 Fix registry and deployment configuration
CI/CD Pipeline to Rancher - SIDATA / build-and-deploy (push) Failing after 3m13s
2026-09-06 14:26:18 +07:00
gitea 04d48abc85 use HTTPS registry via NPM
CI/CD Pipeline to Rancher - SIDATA / build-and-deploy (push) Failing after 2m44s
2026-09-06 13:22:51 +07:00
gitea e7932a2239 ci: use nexus runner image
CI/CD Pipeline to Rancher - SIDATA / build-and-deploy (push) Failing after 5m18s
2026-09-06 12:46:20 +07:00
gitea 018ec9a694 ci: sesuaikan pipeline deploy sidata-prod
CI/CD Pipeline to Rancher - SIDATA / build-and-deploy (push) Failing after 2m3s
2026-09-06 12:22:43 +07:00
gitea 674941939c fix: support sidataprod path behind traefik
CI/CD Pipeline to Rancher - SIDATA / build-and-deploy (push) Failing after 2m3s
2026-09-06 12:02:09 +07:00
gitea 2e4315dc68 first commit
CI/CD Pipeline to Rancher - SIDATA / build-and-deploy (push) Failing after 2m4s
2026-09-05 20:04:37 +07:00
gitea 17604e5f80 chore: purge ignored files from repository tracking 2026-09-05 19:14:53 +07:00
gitea b924b0ea8e feat: initial commit project sidata 2026-09-05 01:34:37 +07:00
gitea f62fd389b7 fix: set ingress class to traefik and apply middleware 2026-09-04 10:42:39 +07:00
gitea 28c13399f4 fix: revert ingress yaml structure to match helm template 2026-09-04 10:14:19 +07:00
gitea 97bd62fd47 fix: standardize pod nginx to root and enable ingress rewrite-target 2026-09-04 09:10:51 +07:00
35 changed files with 832 additions and 112 deletions
+535
View File
@@ -0,0 +1,535 @@
name: CI/CD Pipeline to Rancher - SIDATA
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Test Gitea Action
shell: bash
run: |
echo "=========================================="
echo "SIDATA ACTION BERJALAN"
echo "=========================================="
echo "Repository: $GITHUB_REPOSITORY"
echo "Branch: $GITHUB_REF"
echo "Commit: $GITHUB_SHA"
env:
HTTP_PROXY: http://10.15.3.20:80
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: >-
localhost,127.0.0.1,
10.15.39.0/24,
10.81.2.0/24,
10.42.0.0/16,
10.43.0.0/16,
registry-nexus-bpkd.drc-bpkd.data-center.id,
registry-bpkd.drc-bpkd.data-center.id,
.drc-bpkd.data-center.id,
.bpkd.jakarta.go.id
no_proxy: >-
localhost,127.0.0.1,
10.15.39.0/24,
10.81.2.0/24,
10.42.0.0/16,
10.43.0.0/16,
registry-nexus-bpkd.drc-bpkd.data-center.id,
registry-bpkd.drc-bpkd.data-center.id,
.drc-bpkd.data-center.id,
.bpkd.jakarta.go.id
steps:
# ==========================================================
# 1. WORKSPACE
# ==========================================================
- name: Check Workspace
shell: bash
run: |
set -e
echo "=========================================="
echo "CHECK WORKSPACE"
echo "=========================================="
pwd
echo ""
echo "Repository files:"
ls -la
echo ""
echo "Dockerfile:"
test -f Dockerfile
ls -lh Dockerfile
echo ""
echo "Kubernetes:"
test -d k8s
find k8s -maxdepth 2 -type f -print
# ==========================================================
# 2. CONTAINER ENGINE
# ==========================================================
- name: Check Container Engine
shell: bash
run: |
set -e
echo "=========================================="
echo "CHECK CONTAINER ENGINE"
echo "=========================================="
echo "Docker executable:"
which docker
echo ""
echo "Docker version:"
docker --version
echo ""
echo "Engine:"
docker version
echo ""
echo "Docker socket:"
ls -l /var/run/docker.sock
# ==========================================================
# 3. REGISTRY CONNECTIVITY
# ==========================================================
- name: Check Nexus Connectivity
shell: bash
run: |
set -e
REGISTRY="registry-nexus-bpkd.drc-bpkd.data-center.id"
echo "=========================================="
echo "CHECK NEXUS"
echo "=========================================="
echo "DNS:"
getent hosts "$REGISTRY"
echo ""
echo "HTTPS /v2/:"
HTTP_CODE=$(curl \
--silent \
--show-error \
--output /tmp/nexus-response.txt \
--write-out "%{http_code}" \
--connect-timeout 10 \
--max-time 30 \
"https://${REGISTRY}/v2/" || true)
echo "HTTP status: ${HTTP_CODE}"
if [ "$HTTP_CODE" = "200" ] || [ "$HTTP_CODE" = "401" ]; then
echo "Nexus connectivity OK."
else
echo "ERROR: Nexus tidak dapat diakses."
cat /tmp/nexus-response.txt || true
exit 1
fi
# ==========================================================
# 4. CHECK SECRETS
# ==========================================================
- name: Check Registry Secrets
shell: bash
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
set -e
echo "=========================================="
echo "CHECK REGISTRY SECRETS"
echo "=========================================="
echo "REGISTRY_USER length: ${#REGISTRY_USER}"
echo "REGISTRY_PASSWORD length: ${#REGISTRY_PASSWORD}"
test -n "$REGISTRY_USER"
test -n "$REGISTRY_PASSWORD"
echo "Registry secrets OK."
# ==========================================================
# 5. LOGIN NEXUS
# ==========================================================
- name: Login Nexus
shell: bash
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
set -e
REGISTRY="registry-nexus-bpkd.drc-bpkd.data-center.id"
echo "=========================================="
echo "LOGIN NEXUS"
echo "=========================================="
printf '%s' "$REGISTRY_PASSWORD" | \
docker login "$REGISTRY" \
--username "$REGISTRY_USER" \
--password-stdin
echo "Login Nexus berhasil."
# ==========================================================
# 6. PULL BASE IMAGE
# ==========================================================
- name: Pull Base Image
shell: bash
run: |
set -e
BASE_IMAGE="registry-nexus-bpkd.drc-bpkd.data-center.id/php74-fpm-oci8-lengkap:1.0"
echo "=========================================="
echo "PULL BASE IMAGE"
echo "=========================================="
echo "$BASE_IMAGE"
docker pull "$BASE_IMAGE"
docker image inspect "$BASE_IMAGE" \
--format 'Image ID: {{.Id}}'
echo "Base image OK."
# ==========================================================
# 7. BUILD
# ==========================================================
- name: Build SIDATA
shell: bash
run: |
set -e
echo "=========================================="
echo "BUILD SIDATA"
echo "=========================================="
test -f Dockerfile
docker build \
--load \
--build-arg HTTP_PROXY="$HTTP_PROXY" \
--build-arg HTTPS_PROXY="$HTTPS_PROXY" \
--build-arg http_proxy="$http_proxy" \
--build-arg https_proxy="$https_proxy" \
--build-arg NO_PROXY="$NO_PROXY" \
--build-arg no_proxy="$no_proxy" \
-t sidata:latest .
echo ""
echo "BUILD BERHASIL"
docker image inspect sidata:latest \
--format 'Image ID: {{.Id}}'
# ==========================================================
# 8. TAG
# ==========================================================
- name: Tag SIDATA Image
shell: bash
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
run: |
set -e
REGISTRY="registry-nexus-bpkd.drc-bpkd.data-center.id"
IMAGE="${REGISTRY}/${REGISTRY_USER}/sidata"
SHA="${{ gitea.sha }}"
echo "=========================================="
echo "TAG IMAGE"
echo "=========================================="
docker tag sidata:latest "${IMAGE}:latest"
docker tag sidata:latest "${IMAGE}:${SHA}"
docker image ls | grep sidata
# ==========================================================
# 9. PUSH
# ==========================================================
- name: Push SIDATA Image
shell: bash
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
run: |
set -e
REGISTRY="registry-nexus-bpkd.drc-bpkd.data-center.id"
IMAGE="${REGISTRY}/${REGISTRY_USER}/sidata"
SHA="${{ gitea.sha }}"
echo "=========================================="
echo "PUSH IMAGE"
echo "=========================================="
docker push "${IMAGE}:latest"
docker push "${IMAGE}:${SHA}"
echo "Push berhasil."
# ==========================================================
# 10. INSTALL KUBECTL
# ==========================================================
- name: Install kubectl
shell: bash
run: |
set -e
echo "=========================================="
echo "INSTALL KUBECTL"
echo "=========================================="
KUBECTL_VERSION=$(curl \
--silent \
--show-error \
--fail \
--connect-timeout 10 \
--max-time 30 \
https://dl.k8s.io/release/stable.txt)
echo "Version: $KUBECTL_VERSION"
curl \
--fail \
--show-error \
--location \
--connect-timeout 10 \
--max-time 120 \
"https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" \
-o kubectl
chmod +x kubectl
./kubectl version --client
# ==========================================================
# 11. CONFIGURE RANCHER
# ==========================================================
- name: Configure Rancher
shell: bash
env:
RANCHER_URL: ${{ secrets.RANCHER_URL }}
RANCHER_CLUSTER_ID: ${{ secrets.RANCHER_CLUSTER_ID }}
RANCHER_TOKEN: ${{ secrets.RANCHER_TOKEN }}
run: |
set -e
echo "=========================================="
echo "CONFIGURE RANCHER"
echo "=========================================="
test -n "$RANCHER_URL"
test -n "$RANCHER_CLUSTER_ID"
test -n "$RANCHER_TOKEN"
SERVER="${RANCHER_URL%/}/k8s/clusters/${RANCHER_CLUSTER_ID}"
echo "Rancher API:"
echo "$SERVER"
./kubectl config set-cluster rancher-cluster \
--server="$SERVER" \
--insecure-skip-tls-verify=true
./kubectl config set-credentials rancher-user \
--token="$RANCHER_TOKEN"
./kubectl config set-context rancher-context \
--cluster=rancher-cluster \
--user=rancher-user
./kubectl config use-context rancher-context
# ==========================================================
# 12. TEST RANCHER
# ==========================================================
- name: Test Rancher Connection
shell: bash
run: |
set -e
echo "=========================================="
echo "TEST RANCHER"
echo "=========================================="
./kubectl cluster-info
echo ""
echo "Nodes:"
./kubectl get nodes
# ==========================================================
# 13. CREATE NEXUS PULL SECRET
# ==========================================================
- name: Create Nexus Pull Secret
shell: bash
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
set -e
REGISTRY="registry-nexus-bpkd.drc-bpkd.data-center.id"
NAMESPACE="sidata"
echo "=========================================="
echo "CREATE NEXUS PULL SECRET"
echo "=========================================="
./kubectl create namespace "$NAMESPACE" \
--dry-run=client \
-o yaml | ./kubectl apply -f -
./kubectl create secret docker-registry nexus-registry \
--namespace="$NAMESPACE" \
--docker-server="$REGISTRY" \
--docker-username="$REGISTRY_USER" \
--docker-password="$REGISTRY_PASSWORD" \
--dry-run=client \
-o yaml | ./kubectl apply -f -
echo "Pull secret OK."
# ==========================================================
# 14. DEPLOY MANIFEST
# ==========================================================
- name: Deploy SIDATA
shell: bash
run: |
set -e
echo "=========================================="
echo "DEPLOY SIDATA"
echo "=========================================="
test -d k8s
find k8s -maxdepth 2 -type f -print
./kubectl apply \
--namespace=sidata \
-f k8s/
# ==========================================================
# 15. SET IMAGE
# ==========================================================
- name: Update SIDATA Image
shell: bash
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
run: |
set -e
REGISTRY="registry-nexus-bpkd.drc-bpkd.data-center.id"
IMAGE="${REGISTRY}/${REGISTRY_USER}/sidata:${{ gitea.sha }}"
echo "=========================================="
echo "UPDATE IMAGE"
echo "=========================================="
echo "$IMAGE"
./kubectl set image \
deployment/sidata \
sidata="$IMAGE" \
--namespace=sidata
# ==========================================================
# 16. IMAGE PULL SECRET
# ==========================================================
- name: Configure Image Pull Secret
shell: bash
run: |
set -e
echo "=========================================="
echo "CONFIGURE IMAGE PULL SECRET"
echo "=========================================="
./kubectl patch deployment sidata \
--namespace=sidata \
--type=strategic \
-p '{"spec":{"template":{"spec":{"imagePullSecrets":[{"name":"nexus-registry"}]}}}}'
# ==========================================================
# 17. ROLLOUT
# ==========================================================
- name: Rollout SIDATA
shell: bash
run: |
set -e
echo "=========================================="
echo "ROLLOUT SIDATA"
echo "=========================================="
./kubectl rollout status \
deployment/sidata \
--namespace=sidata \
--timeout=180s
# ==========================================================
# 18. VERIFY
# ==========================================================
- name: Verify SIDATA
shell: bash
run: |
set -e
echo "=========================================="
echo "VERIFY SIDATA"
echo "=========================================="
echo ""
echo "Deployment:"
./kubectl get deployment sidata \
--namespace=sidata \
-o wide
echo ""
echo "Pods:"
./kubectl get pods \
--namespace=sidata \
-l app=sidata \
-o wide
echo ""
echo "Service:"
./kubectl get service \
--namespace=sidata \
-o wide
echo ""
echo "Ingress:"
./kubectl get ingress \
--namespace=sidata \
-o wide || true
echo ""
echo "=========================================="
echo "SIDATA DEPLOYMENT SELESAI"
echo "=========================================="
# trigger 20260907-143823
+16
View File
@@ -0,0 +1,16 @@
/node_modules
/public/hot
/public/storage
/public/uploadFiles
/public/downloadFiles
/storage/*.key
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/.idea
/.vscode
+109 -88
View File
@@ -1,88 +1,109 @@
FROM 10.15.39.186:8083/php74-fpm-oci8-lengkap:1.0
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}
# =========================================================
# System dependencies & Extensions
# =========================================================
RUN echo "deb [trusted=yes] http://10.15.39.186:8081/repository/debian-proxy/ bullseye main" > /etc/apt/sources.list \
&& echo "deb [trusted=yes] http://10.15.39.186:8081/repository/debian-proxy/ bullseye-updates main" >> /etc/apt/sources.list \
&& rm -rf /etc/apt/sources.list.d/* \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
nginx \
redis-server \
procps \
vim \
wget \
curl \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libzip-dev \
libaio1 \
libaio-dev \
unzip \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd pdo pdo_mysql zip \
&& curl --noproxy "*" -fsSL http://10.15.39.186:8081/repository/raw-assets/storage/app/uploads/redis-5.3.7.tgz -o redis.tgz \
&& pecl install redis.tgz \
&& docker-php-ext-enable redis \
&& rm -f redis.tgz \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /var/www/html
# Salin source code aplikasi
COPY . /var/www/html
# Buat file .env dari .env.example jika .env belum ada di repositori
RUN if [ ! -f .env ]; then \
if [ -f .env.example ]; then \
cp .env.example .env; \
else \
echo "APP_NAME=Sidata\nAPP_ENV=production\nAPP_KEY=\nAPP_DEBUG=true\nAPP_URL=https://dashboard-bpkd.drc-bpkd.data-center.id/sidata" > .env; \
fi \
fi
# Atur hak akses folder web, storage, dan cache Laravel
RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 775 /var/www/html/storage \
&& chmod -R 775 /var/www/html/bootstrap/cache
# Konfigurasi Nginx presisi untuk subpath /sidata dan PHP-FPM
RUN echo 'server { \
listen 80; \
index index.php index.html; \
root /var/www/html/public; \
\
location /sidata { \
try_files $uri $uri/ /sidata/index.php?$query_string; \
} \
\
location / { \
try_files $uri $uri/ /index.php?$query_string; \
} \
\
location ~ \.php$ { \
fastcgi_pass 127.0.0.1:9000; \
fastcgi_index index.php; \
include fastcgi_params; \
fastcgi_param SCRIPT_FILENAME /var/www/html/public/index.php; \
fastcgi_param SCRIPT_NAME $fastcgi_script_name; \
} \
}' > /etc/nginx/sites-available/default
# ... (bagian atas Dockerfile tetap sama) ...
EXPOSE 80
# Script startup: Buat .env dari variabel environment Helm jika .env belum ada, lalu jalankan service
CMD ["sh", "-c", "env | grep -E '^(APP_|DB_|MYSQL_|ORA_|REDIS_|MAIL_|SESSION_|SOA_)' > /var/www/html/.env && redis-server --daemonize yes && php-fpm -D && exec nginx -g 'daemon off;'"]
FROM registry-nexus-bpkd.drc-bpkd.data-center.id/php74-fpm-oci8-lengkap:1.0
# =========================================================
# Build arguments & Environment variables
# =========================================================
ARG http_proxy
ARG https_proxy
ARG no_proxy
ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG NO_PROXY
ENV http_proxy=${http_proxy} \
https_proxy=${https_proxy} \
no_proxy=${no_proxy} \
HTTP_PROXY=${HTTP_PROXY} \
HTTPS_PROXY=${HTTPS_PROXY} \
NO_PROXY=${NO_PROXY}
# =========================================================
# System dependencies
# =========================================================
RUN set -eux; \
echo "deb [trusted=yes] http://10.15.39.186:8081/repository/debian-proxy/ bullseye main" > /etc/apt/sources.list; \
echo "deb [trusted=yes] http://10.15.39.186:8081/repository/debian-proxy/ bullseye-updates main" >> /etc/apt/sources.list; \
rm -rf /etc/apt/sources.list.d/*; \
apt-get update; \
apt-get install -y --no-install-recommends \
nginx \
redis-server \
procps \
vim \
wget \
curl \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libzip-dev \
libaio1 \
libaio-dev \
unzip; \
docker-php-ext-configure gd --with-freetype --with-jpeg; \
docker-php-ext-install gd pdo pdo_mysql zip; \
curl --noproxy "" -fsSL http://10.15.39.186:8081/repository/raw-assets/storage/app/uploads/redis-5.3.7.tgz -o /tmp/redis.tgz; \
pecl install /tmp/redis.tgz; \
docker-php-ext-enable redis; \
rm -f /tmp/redis.tgz; \
rm -rf /var/lib/apt/lists/*
# =========================================================
# Application
# =========================================================
WORKDIR /var/www/html
COPY . /var/www/html
# =========================================================
# Laravel permissions
# =========================================================
RUN set -eux; \
mkdir -p /var/www/html/storage /var/www/html/bootstrap/cache; \
chown -R www-data:www-data /var/www/html; \
chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache
# =========================================================
# Nginx configuration
# =========================================================
RUN set -eux; \
rm -f /etc/nginx/sites-enabled/default /etc/nginx/sites-available/default; \
printf '%s\n' \
'server {' \
' listen 80;' \
' server_name _;' \
' root /var/www/html/public;' \
' index index.php index.html;' \
'' \
' 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 HTTP_X_FORWARDED_PROTO $http_x_forwarded_proto;' \
' fastcgi_param HTTP_X_FORWARDED_PREFIX /sidataprod;' \
' }' \
'' \
' location ~ /\.ht {' \
' deny all;' \
' }' \
'}' > /etc/nginx/sites-available/default; \
ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default; \
mkdir -p /run/nginx
# =========================================================
# Laravel URL & Environment Variables
# =========================================================
ENV APP_ENV=production \
APP_DEBUG=false \
APP_URL=https://dashboard-bpkd.drc-bpkd.data-center.id/sidataprod
# =========================================================
# Expose & Startup
# =========================================================
EXPOSE 80
CMD ["sh", "-c", "set -e; if [ ! -f /var/www/html/.env ]; then if [ -f /var/www/html/.env.example ]; then cp /var/www/html/.env.example /var/www/html/.env; else touch /var/www/html/.env; fi; fi; tmp_env=$(mktemp); env | grep -E '^(APP_|DB_|MYSQL_|ORA_|REDIS_|MAIL_|SESSION_|SOA_)' > \"$tmp_env\" || true; if [ -s \"$tmp_env\" ]; then cat \"$tmp_env\" > /var/www/html/.env; fi; rm -f \"$tmp_env\"; chown www-data:www-data /var/www/html/.env; chmod 664 /var/www/html/.env; redis-server --daemonize yes; php-fpm -D; exec nginx -g 'daemon off;'"]
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -16,7 +16,7 @@ class Authenticate extends Middleware
{
if (! $request->expectsJson()) {
// Paksa redirect membawa prefix /sidata agar tidak terlempar ke root domain
return url('/sidata/login');
return redirect()->guest(route('login'));
}
}
}
+5 -14
View File
@@ -2,22 +2,13 @@
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array|string|null
*/
protected $proxies = '*';
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
}
protected $headers = [
\Illuminate\Http\Request::HEADER_X_FORWARDED_ALL,
];
}
+1 -1
View File
@@ -17,7 +17,7 @@ class RouteServiceProvider extends ServiceProvider
*
* @var string
*/
public const HOME = '/sidata/home';
public const HOME = '/home';
/**
* The controller namespace for the application.
Submodule
+1
Submodule gitea-test added at 6b0ee8ee4b
+1 -1
View File
@@ -6,4 +6,4 @@
# spec:
# stripPrefix:
# prefixes:
# - /sidata
# - /sidataprod
+9 -7
View File
@@ -13,14 +13,16 @@ service:
ingress:
enabled: true
className: nginx
className: traefik
annotations:
# HAPUS rewrite-target agar URL /sidata diteruskan utuh ke Pod
# Nginx di dalam Pod kita sudah punya 'location /sidata'
nginx.ingress.kubernetes.io/ssl-redirect: "false"
host: dashboard-bpkd.drc-bpkd.data-center.id
path: /sidata
pathType: Prefix
traefik.ingress.kubernetes.io/router.middlewares: sidata-prod-fix-sidata-prefix@kubernetescrd
traefik.ingress.kubernetes.io/service.sticky.cookie: "true"
traefik.ingress.kubernetes.io/service.sticky.cookie.name: SIDATA_STICKY
hosts:
- host: dashboard-bpkd.drc-bpkd.data-center.id
paths:
- path: /sidata
pathType: Prefix
env:
APP_NAME: "SIDATA"
+106
View File
@@ -0,0 +1,106 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sidataprod
namespace: sidata
spec:
replicas: 1
selector:
matchLabels:
app: sidataprod
template:
metadata:
labels:
app: sidataprod
spec:
imagePullSecrets:
- name: registry-bpkd
containers:
- name: sidataprod
image: registry-bpkd.drc-bpkd.data-center.id/REGISTRY_USER/sidata:latest
imagePullPolicy: Always
ports:
- containerPort: 80
protocol: TCP
env:
- name: APP_ENV
value: "production"
- name: APP_DEBUG
value: "false"
- name: APP_URL
value: "https://dashboard-bpkd.drc-bpkd.data-center.id/sidataprod"
- name: DB_HOST
valueFrom:
secretKeyRef:
name: sidataprod-secret
key: DB_HOST
- name: DB_PORT
valueFrom:
secretKeyRef:
name: sidataprod-secret
key: DB_PORT
- name: DB_DATABASE
valueFrom:
secretKeyRef:
name: sidataprod-secret
key: DB_DATABASE
- name: DB_USERNAME
valueFrom:
secretKeyRef:
name: sidataprod-secret
key: DB_USERNAME
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: sidataprod-secret
key: DB_PASSWORD
- name: REDIS_HOST
value: "127.0.0.1"
- name: REDIS_PORT
value: "6379"
resources:
requests:
cpu: "250m"
memory: "512Mi"
limits:
cpu: "1000m"
memory: "1Gi"
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
livenessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 40
periodSeconds: 20
timeoutSeconds: 5
failureThreshold: 5
+30
View File
@@ -0,0 +1,30 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: sidataprod
namespace: sidata
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/proxy-body-size: "50m"
nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
spec:
ingressClassName: nginx
rules:
- host: dashboard-bpkd.drc-bpkd.data-center.id
http:
paths:
- path: /sidataprod(/|$)(.*)
pathType: ImplementationSpecific
backend:
service:
name: sidataprod
port:
number: 80
+18
View File
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: sidataprod
namespace: sidata
spec:
type: ClusterIP
selector:
app: sidataprod
ports:
- name: http
port: 80
targetPort: 80
protocol: TCP
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
View File
View File
View File
View File
View File
Executable → Regular
View File