fix: add /sidata location support in nginx and fallback .env generator

This commit is contained in:
2026-09-04 08:41:08 +07:00
parent ff05d0772d
commit 97e5806526
+12 -2
View File
@@ -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; \
} \