Cloud UYM Campus Cloud Platform
Docs / Framework Guides / Deploy Laravel 12

Dokumentasi Pengembang & Spesifikasi Server

Panduan teknis resmi arsitektur cloud Universitas Yarsi Madani untuk orkestrasi aplikasi mahasiswa, integrasi repositori Git, dan runtime performa tinggi.

PHP 8.3 FPM Node.js 22 LTS Python 3.12 MariaDB 10.11 Git Webhooks
⌘K
Revisi Terakhir: 18 Mei 2025 v3.4.1 Production
Production Runbook #LAR-1209

Deploying Laravel 12 Application on Cloud UYM

Panduan lengkap instalasi, konfigurasi virtual host Nginx, dan setup otomasi Git Webhook untuk aplikasi Laravel 12 di server cluster komputasi Universitas Yarsi Madani.

Akun cPanel Kampus SSO aktif via NIM / NIDN
Git Repo Mahasiswa GitHub, GitLab, atau Git UYM
PHP 8.3 & Composer 2.7 Terpasang secara native
1

Persiapan Repository & File .env.production

Sebelum mendorong kode ke server, pastikan variabel lingkungan produksi telah disesuaikan dengan konfigurasi jaringan internal kampus. Hindari mengunggah kunci aplikasi privat ke repository publik.

.env.production
APP_NAME="SIAKAD UYM"
APP_ENV=production
APP_KEY=base64:cK15Y28198fA019X8k...UYM_APP_KEY=
APP_DEBUG=false
APP_URL=https://proyek-anda.student.uym.ac.id

# Konfigurasi MariaDB Kampus UYM
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_SOCKET=/var/run/mysqld/mysqld.sock
DB_DATABASE=uym_student_laravel
DB_USERNAME=uym_app_user
DB_PASSWORD=Str0ngP@ssw0rdUYM2025!

# Optimasi Cache Sesi & Queue Mahasiswa
CACHE_STORE=redis
SESSION_DRIVER=redis
QUEUE_CONNECTION=redis
Tip Akselerasi Database:

Gunakan direct socket lokal /var/run/mysqld/mysqld.sock alih-alih koneksi TCP 127.0.0.1:3306 untuk mendapatkan reduksi latensi hingga 35% pada query intensif.

2

Konfigurasi Git Webhook Otomatis di Panel Cloud UYM

Daftarkan webhook pada repositori GitHub/GitLab Anda agar Cloud UYM mengeksekusi build pipeline setiap kali commit berhasil dipush ke branch main.

Payload Webhook URL: SSL Verified HTTPS
https://panel.uym.ac.id/deploy-hook/v1/projects/uym-mhs-49102-laravel
Content Type application/json
Secret Token uym_sec_99a81f09c8...
3

Script Hook Build (post-receive script)

Skrip ini dijalankan oleh isolated container worker di Cloud UYM. Composer dependencies akan di-cache untuk mempercepat durasi deploy.

deploy.sh (Post-Receive Automation)
Bash script
#!/bin/bash
set -e

# 1. Pindah ke direktori publik mahasiswa
cd /var/www/vhosts/student.uym.ac.id/laravel-app

# 2. Tarik kode versi terbaru
git pull origin main

# 3. Instal dependensi PHP dengan optimasi classmap
composer install --no-dev --optimize-autoloader --no-interaction

# 4. Migrasi skema database kampusan secara aman
php artisan migrate --force

# 5. Kompilasi dan cache seluruh rute, config, dan blade view
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan event:cache

# 6. Restart worker queue & bersihkan cache OPcache
php artisan queue:restart
systemctl reload php8.3-fpm

echo "✓ Laravel 12 Berhasil Terdeploy di Cloud UYM!"
4

Konfigurasi Nginx Document Root pointing ke /public

Demi alasan integritas sistem dan keamanan file rahasia (.env, database SQLite, dsb), document root wajib diarahkan secara presisi ke sub-folder /public.

/etc/nginx/conf.d/vhost-laravel.conf Nginx Engine
server {
    listen 443 ssl http2;
    server_name proyek-anda.student.uym.ac.id;
    root /var/www/vhosts/student.uym.ac.id/laravel-app/public;

    index index.php index.html;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

Alur Verifikasi Deployment Sukses

All Checks Passed
Git Push main GitHub/GitLab UYM Webhook Payload Authed Composer & Migrate Build Runner Live Production HTTP 200 OK
Rata-rata durasi pipeline: 14.2 detik Buka Live Deployment Log
Apakah dokumentasi ini bermanfaat?

Bantu tim DTIK UYM meningkatkan kualitas panduan teknis kampus.

Edit di Git Kampus