-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
106 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
############################# | ||
## Init MySQL | ||
############################# | ||
|
||
echo "[client] | ||
host=mysql | ||
user=\"$MYSQL_USER\" | ||
password=\"$MYSQL_PASSWORD\" | ||
[mysql] | ||
host=mysql | ||
user=\"$MYSQL_USER\" | ||
password=\"$MYSQL_PASSWORD\" | ||
database=\"$MYSQL_DATABASE\" | ||
default-character-set=utf8 | ||
local-infile=1 | ||
show-warnings | ||
auto-rehash | ||
sigint-ignore | ||
reconnect | ||
[mysqldump] | ||
host=mysql | ||
user=\"$MYSQL_USER\" | ||
password=\"$MYSQL_PASSWORD\" | ||
" | tee /root/.my.cnf > /home/.my.cnf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
|
||
############################# | ||
## Init PHP | ||
############################# | ||
echo " | ||
date.timezone = ${PHP_TIMEZONE} | ||
" >> /etc/php5/mods-available/docker-boilerplate.ini | ||
|
||
############################# | ||
## Init PHP-FPM | ||
############################# | ||
|
||
# Backup original | ||
if [ ! -f "/opt/docker/.fpm-www.conf" ]; then | ||
cp /etc/php5/fpm/pool.d/www.conf /opt/docker/.fpm-www.conf | ||
fi | ||
|
||
## Remove old logs | ||
rm -f -- /tmp/php.access.log /tmp/php.slow.log /tmp/php.error.log | ||
touch -- /tmp/php.access.log /tmp/php.slow.log /tmp/php.error.log | ||
chmod 666 /tmp/php.access.log /tmp/php.slow.log /tmp/php.error.log | ||
|
||
# Restore original | ||
cp /opt/docker/.fpm-www.conf /etc/php5/fpm/pool.d/www.conf | ||
sed -i "s@listen = /var/run/php5-fpm.sock@listen = 9000@" /etc/php5/fpm/pool.d/www.conf | ||
|
||
# Manipulate php-fpm configuration | ||
echo " | ||
; Server resource settings | ||
pm.max_children = 10 | ||
pm.start_servers = 2 | ||
pm.min_spare_servers = 1 | ||
pm.max_spare_servers = 3 | ||
catch_workers_output = yes | ||
access.format = \"%R - %u %t \\\"%m %r%Q%q\\\" %s %f cpu:%C%% mem:%{megabytes}M reqTime:%d\" | ||
access.log = /tmp/php.access.log | ||
slowlog = /tmp/php.slow.log | ||
request_slowlog_timeout = 30s | ||
php_admin_value[error_log] = /tmp/php.error.log | ||
php_admin_flag[log_errors] = on | ||
env[TYPO3_CONTEXT] = ${TYPO3_CONTEXT} | ||
env[FLOW_CONTEXT] = ${FLOW_CONTEXT} | ||
env[FLOW_REWRITEURLS] = ${FLOW_REWRITEURLS} | ||
" >> /etc/php5/fpm/pool.d/www.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
############################# | ||
## Init SSMTP | ||
############################# | ||
|
||
sed -i "s/mailhub=.*/mailhub=${MAIL_GATEWAY}/" /etc/ssmtp/ssmtp.conf | ||
sed -i "s/#FromLineOverride=.*/FromLineOverride=YES/" /etc/ssmtp/ssmtp.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
## Set uid/gid for www-data user | ||
usermod --uid "${PHP_UID}" --shell /bin/bash --home /home www-data | ||
groupmod --gid "${PHP_GID}" www-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters