Skip to content

Commit

Permalink
fix: added mechanism to update connectors and manager folder as well …
Browse files Browse the repository at this point in the history
…as better php settings
  • Loading branch information
749 committed Nov 18, 2024
1 parent faef6e1 commit b20f643
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN cd / \
&& mv /usr/src/modx-${MODX_VERSION}-pl/ /modx/public \
&& find /modx -name 'ht.access' -exec bash -c 'rm $0' {} \; \
&& mv /modx/public/core /modx/ \
&& cp -r /modx/public/setup /usr/src/modx \
&& cp -r /modx/public/setup /modx/public/connectors /modx/public/manager /usr/src/modx \
&& rm modx.zip \
&& chown -R www-data:www-data /modx

Expand Down
6 changes: 5 additions & 1 deletion build/files/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then

chown www-data:www-data setup/config.xml

sudo -u www-data php setup/index.php --installmode=new
sudo -u www-data php setup/index.php --installmode=new

echo "$MODX_VERSION" >/modx/core/config/install_version.txt

Expand All @@ -88,6 +88,10 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then

envsubst > config.xml </docker-entrypoint/upgrade.xml

echo >&2 "Updating manager/ and connectors/..."
rm -rf /modx/public/connectors/ /modx/public/manager/
cp -r /usr/src/modx/connectors /usr/src/modx/manager /modx/public/

chown -R www-data:www-data /modx

sudo -u www-data php setup/index.php --installmode=upgrade
Expand Down
26 changes: 26 additions & 0 deletions build/files/php-config/production.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
open_basedir = /modx/:/tmp/:/usr/local/lib/php
display_errors = Off
display_startup_errors = Off
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
log_errors = On
max_input_time = 120
output_buffering = 4096
#register_argc_argv = Off
request_order = "GP"
session.gc_divisor = 1000
session.sid_bits_per_character = 5
session.sid_length = 42
short_open_tag = Off
variables_order = "GPCS"
zend.assertions = -1
zend.exception_ignore_args = On
zend.exception_string_param_max_len = 0

expose_php = Off
allow_url_include = Off
register_globals = Off

post_max_size = 10M
file_uploads = On
upload_max_filesize = 10M
max_file_uploads = 10
1 change: 0 additions & 1 deletion build/files/php-config/recommended.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# set recommended PHP.ini settings
# recomended from https://tkacz.pro/php-fpm-config-improvements/
log_level = warning
emergency_restart_threshold = 20
emergency_restart_interval = 1m
process_control_timeout = 10s
Expand Down

0 comments on commit b20f643

Please sign in to comment.