fix: add /sidata location support in nginx and fallback .env generator
This commit is contained in:
+12
-2
@@ -44,18 +44,28 @@ WORKDIR /var/www/html
|
|||||||
COPY . /var/www/html
|
COPY . /var/www/html
|
||||||
|
|
||||||
# Buat file .env dari .env.example jika .env belum ada di repositori
|
# 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
|
# Atur hak akses folder web, storage, dan cache Laravel
|
||||||
RUN chown -R www-data:www-data /var/www/html \
|
RUN chown -R www-data:www-data /var/www/html \
|
||||||
&& chmod -R 775 /var/www/html/storage \
|
&& chmod -R 775 /var/www/html/storage \
|
||||||
&& chmod -R 775 /var/www/html/bootstrap/cache
|
&& chmod -R 775 /var/www/html/bootstrap/cache
|
||||||
|
|
||||||
# Konfigurasi Nginx
|
# Konfigurasi Nginx untuk mendukung path / dan /sidata
|
||||||
RUN echo 'server { \
|
RUN echo 'server { \
|
||||||
listen 80; \
|
listen 80; \
|
||||||
index index.php index.html; \
|
index index.php index.html; \
|
||||||
root /var/www/html/public; \
|
root /var/www/html/public; \
|
||||||
|
location /sidata { \
|
||||||
|
alias /var/www/html/public; \
|
||||||
|
try_files $uri $uri/ /sidata/index.php?$query_string; \
|
||||||
|
} \
|
||||||
location / { \
|
location / { \
|
||||||
try_files $uri $uri/ /index.php?$query_string; \
|
try_files $uri $uri/ /index.php?$query_string; \
|
||||||
} \
|
} \
|
||||||
|
|||||||
Reference in New Issue
Block a user