Skip to content

Commit

Permalink
Merge pull request #47 from joey741019/patch-1
Browse files Browse the repository at this point in the history
Add modify PHP env
  • Loading branch information
scline authored Jul 14, 2019
2 parents 61425da + 00d8ba1 commit c8b6ec6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ ENV \
REMOTE_POLLER=0 \
INITIALIZE_DB=0 \
INITIALIZE_INFLUX=0 \
TZ=UTC
TZ=UTC \
PHP_MEMORY_LIMIT=128M \
PHP_MAX_EXECUTION_TIME=30

## --- Start ---
COPY start.sh /start.sh
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ The main cacti poller settings, these are required for single cacti and multi ca
| BACKUP_RETENTION | Number of backup files to keep. |
| BACKUP_TIME | How often Cacti should back itself up in minutes - currently not working |
| REMOTE_POLLER | Can be `0` for false (default) or `1` for true. |
| PHP_MEMORY_LIMIT | PHP memory limit adjust, by defaults its 128M |
| PHP_MAX_EXECUTION_TIME | PHP max execution time adjust, by defaults its 30 second |

### Remote Cacti Pollers
Remote cacti poller containers require the following, the major differance here is the inclusion of RDB (remote database) variables which should be pointed at the master cacti installation settings.
Expand Down
5 changes: 5 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
# set server timezone
echo "$(date +%F_%R) [Note] Setting server timezone settings to '${TZ}'"
echo "date.timezone = ${TZ}" >> /etc/php.ini

# set custom php.ini enviorments to follow Cacti Recommendations requirment
sed -i "s/^\(memory_limit=\).*/\1 ${PHP_MEMORY_LIMIT}/" /etc/php.ini
sed -i "s/^\(max_execution_time=\).*/\1 ${PHP_MAX_EXECUTION_TIME}/" /etc/php.ini

rm /etc/localtime
ln -s /usr/share/zoneinfo/${TZ} /etc/localtime

Expand Down

0 comments on commit c8b6ec6

Please sign in to comment.