From 97e5806526a65d2dd928f3e7a37438a5d95519e8 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 4 Sep 2026 08:41:08 +0700 Subject: [PATCH] fix: add /sidata location support in nginx and fallback .env generator --- Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 604d14b..9ffb5e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,18 +44,28 @@ WORKDIR /var/www/html COPY . /var/www/html # Buat file .env dari .env.example jika .env belum ada di repositori -RUN if [ ! -f .env ]; then cp .env.example .env; fi +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 +# Konfigurasi Nginx untuk mendukung path / dan /sidata RUN echo 'server { \ listen 80; \ index index.php index.html; \ root /var/www/html/public; \ + location /sidata { \ + alias /var/www/html/public; \ + try_files $uri $uri/ /sidata/index.php?$query_string; \ + } \ location / { \ try_files $uri $uri/ /index.php?$query_string; \ } \