D
Setup

Deployment

Cara deploy Admin Dazo ke production — server requirements, build process, dan konfigurasi.

Server Requirements

  • PHP ^8.1
  • Composer
  • Node.js ^18 + npm
  • MongoDB (production cluster)
  • MySQL (untuk live chat)
  • Nginx / Apache
  • SSL certificate

Build Process

Pull latest code
bash
git pull origin main
Install PHP dependencies
bash
composer install --no-dev --optimize-autoloader
Install Node dependencies & build
bash
npm install
npm run build
Laravel optimization
bash
php artisan config:cache
php artisan route:cache
php artisan view:cache
Set permissions
bash
chmod -R 775 storage bootstrap/cache

Nginx Configuration

nginx
server {
    listen 80;
    server_name admin.dazo.id;
    root /var/www/admin-dazo/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";

    index index.php;

    charset utf-8;

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

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

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

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

Environment Production

plaintext
APP_ENV=production
APP_DEBUG=false
APP_URL=https://admin.dazo.id

# Database production
MONGO_DB_HOST=<production-mongo-host>
MONGO_DB_DATABASE=dazo
MONGO_COENDOR_DB_HOST=<production-mongo-host>
MONGO_COENDOR_DB_DATABASE=covendor_prod
CRM_DB_HOST=<production-mongo-host>
CRM_DB_DATABASE=crm
MYSQL_DB_HOST=<production-mysql-host>
MYSQL_DB_DATABASE=dazo

# DOKU production
DOKU_BASE_URL=https://api.doku.com
DOKU_CLIENT_ID=<production-client-id>
DOKU_SECRET_KEY=<production-secret-key>

Post-Deploy Checklist

  • php artisan config:cache berhasil
  • npm run build berhasil
  • Login page accessible
  • Ganti password superadmin default
  • Cek koneksi MongoDB (semua 3 koneksi)
  • Cek koneksi MySQL
  • Cek DOKU API connectivity
  • Cek engine WhatsApp connectivity