Skip to content

Commit dbf216a

Browse files
authored
Merge pull request #4 from kariricode/develop
Develop
2 parents f0c6fe4 + b61becb commit dbf216a

3 files changed

Lines changed: 21 additions & 16 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.1
1+
1.4.2

docker-entrypoint.sh

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -171,23 +171,30 @@ if [ -f "/var/www/html/bin/console" ]; then
171171
fi
172172
fi
173173

174-
# Install demo index.php if no application is mounted
174+
# Install demo index.php if no application is mounted AND DEMO_MODE is enabled
175175
if [ ! -f "/var/www/html/public/index.php" ]; then
176-
log_info "No application detected. Installing demo landing page..."
177-
178-
if [ -f "/usr/local/share/php-api-stack/index.php" ]; then
179-
cp /usr/local/share/php-api-stack/index.php /var/www/html/public/index.php
180-
log_info "Demo landing page installed"
181-
else
182-
log_warning "Demo template not found, creating basic fallback"
183-
cat > /var/www/html/public/index.php << 'EOF'
176+
if [ "${DEMO_MODE}" = "true" ]; then
177+
log_info "DEMO_MODE enabled. Installing demo landing page..."
178+
179+
# Create directory if it doesn't exist
180+
mkdir -p /var/www/html/public
181+
182+
if [ -f "/usr/local/share/php-api-stack/index.php" ]; then
183+
cp /usr/local/share/php-api-stack/index.php /var/www/html/public/index.php
184+
log_info "Demo landing page installed"
185+
else
186+
log_warning "Demo template not found, creating basic fallback"
187+
cat > /var/www/html/public/index.php << 'EOF'
184188
<?php
185189
phpinfo();
186190
EOF
191+
fi
192+
193+
chown nginx:nginx /var/www/html/public/index.php
194+
chmod 644 /var/www/html/public/index.php
195+
else
196+
log_info "No application detected and DEMO_MODE not enabled - skipping demo installation"
187197
fi
188-
189-
chown nginx:nginx /var/www/html/public/index.php
190-
chmod 644 /var/www/html/public/index.php
191198
else
192199
log_info "Application detected at /var/www/html/public/index.php - skipping demo installation"
193200
fi

php/php.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ session.gc_divisor = 1000
8888
session.gc_maxlifetime = 1440
8989
session.cache_limiter = nocache
9090
session.cache_expire = 180
91-
session.sid_length = 32
92-
session.sid_bits_per_character = 6
9391

9492
; OPcache
9593
opcache.enable = ${PHP_OPCACHE_ENABLE}
@@ -174,7 +172,7 @@ xdebug.output_dir = /tmp
174172
xdebug.log = /var/log/php/xdebug.log
175173

176174
; Security
177-
open_basedir = /var/www/html:/tmp:/usr/local/lib/php:/usr/share/php
175+
open_basedir = "/var/www/html:/tmp:/usr/local/lib/php:/usr/share/php:/usr/local/bin:/composer:/root"
178176
; disable_functions = exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
179177
disable_functions = exec,passthru,shell_exec,system,popen,show_source
180178

0 commit comments

Comments
 (0)