Skip to content

Commit d78c326

Browse files
Read-only improveemnts (#62)
1 parent e5f3718 commit d78c326

File tree

77 files changed

+190
-330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+190
-330
lines changed

images/php/7.2-cli/Dockerfile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
# This file is automatically generated. Do not edit directly. #
22
FROM php:7.2-cli
3+
34
ARG COMPOSER_VERSION=1.10.22
5+
ARG MAGENTO_ROOT=/app
6+
ARG COMPOSER_ALLOW_SUPERUSER=1
7+
ARG COMPOSER_HOME=/composer
8+
ARG CRONTAB=""
49

510
ENV COMPOSER_MEMORY_LIMIT -1
6-
ENV PHP_MEMORY_LIMIT 2G
7-
ENV MAGENTO_ROOT /app
11+
ENV PHP_MEMORY_LIMIT -1
12+
ENV PHP_VALIDATE_TIMESTAMPS 1
813
ENV DEBUG false
914
ENV MAGENTO_RUN_MODE production
10-
ENV COMPOSER_ALLOW_SUPERUSER 1
11-
ENV COMPOSER_HOME /composer
12-
ENV ENABLE_SENDMAIL true
15+
ENV SENDMAIL_PATH /dev/null
16+
ENV PHPRC ${MAGENTO_ROOT}/php.ini
1317

1418
ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sysvmsg sysvsem sysvshm xsl zip pcntl
1519

@@ -206,7 +210,8 @@ RUN mkdir -p ${MAGENTO_ROOT}
206210

207211
VOLUME ${MAGENTO_ROOT}
208212

209-
RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d ${MAGENTO_ROOT} /composer
213+
RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME}
214+
RUN if [[ ! -z "${CRONTAB}" ]]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi
210215

211216
ENTRYPOINT ["/docker-entrypoint.sh"]
212217

images/php/7.2-cli/docker-entrypoint.sh

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,19 @@
22

33
[ "$DEBUG" = "true" ] && set -x
44

5-
CRON_LOG=/var/log/cron.log
6-
75
if [ ! -z "${CRONTAB}" ]; then
8-
echo "${CRONTAB}" > /etc/cron.d/magento
6+
echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log
97
fi
108

11-
touch $CRON_LOG
12-
139
PHP_EXT_DIR=/usr/local/etc/php/conf.d
1410

15-
# Configure Sendmail if required
16-
if [ "$ENABLE_SENDMAIL" == "true" ]; then
17-
sed -i "s/!SENDMAIL_PATH!/\"\/usr\/local\/bin\/mhsendmail --smtp-addr=mailhog:1025\"/" ${PHP_EXT_DIR}/zz-mail.ini
18-
else
19-
sed -i "s/!SENDMAIL_PATH!/\"true > \/dev\/null\"/" ${PHP_EXT_DIR}/zz-mail.ini
20-
fi
21-
22-
# Substitute in php.ini values
23-
[ ! -z "${PHP_MEMORY_LIMIT}" ] && sed -i "s/!PHP_MEMORY_LIMIT!/${PHP_MEMORY_LIMIT}/" ${PHP_EXT_DIR}/zz-magento.ini
24-
[ ! -z "${UPLOAD_MAX_FILESIZE}" ] && sed -i "s/!UPLOAD_MAX_FILESIZE!/${UPLOAD_MAX_FILESIZE}/" ${PHP_EXT_DIR}/zz-magento.ini
25-
26-
# Add custom php.ini if it exists
27-
[ -f "/app/php.ini" ] && cp /app/php.ini ${PHP_EXT_DIR}/zzz-custom-php.ini
28-
29-
# Add developer php.ini if it exists
30-
[ -f "/app/php.dev.ini" ] && [ "$MAGENTO_RUN_MODE" == "developer" ] && cp /app/php.dev.ini ${PHP_EXT_DIR}/zzz-dev-php.ini
31-
3211
# Enable PHP extensions
3312
PHP_EXT_COM_ON=docker-php-ext-enable
3413

3514
[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini
3615

3716
if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then
38-
${PHP_EXT_COM_ON} ${PHP_EXTENSIONS}
17+
${PHP_EXT_COM_ON} ${PHP_EXTENSIONS}
3918
fi
4019

4120
# Configure composer

images/php/7.2-cli/etc/mail.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
; Sendmail
2-
sendmail_path=!SENDMAIL_PATH!
2+
sendmail_path = ${SENDMAIL_PATH}

images/php/7.2-cli/etc/php-cli.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
; php.ini
2-
memory_limit = -1
2+
memory_limit = ${PHP_MEMORY_LIMIT}
33
zlib.output_compression = on
44
realpath_cache_size = 32k
55
realpath_cache_ttl = 7200
66
always_populate_raw_post_data = -1
77
max_input_vars = 10000
88
session.gc_probability = 1
99
opcache.enable = 1
10+
opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS}

images/php/7.2-cli/etc/php-gnupg.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
extension=gnupg.so
1+
extension = gnupg.so

images/php/7.2-cli/etc/php-pcov.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pcov.enabled=1
2-
pcov.directory=/app
1+
pcov.enabled = 1
2+
pcov.directory = ${MAGENTO_ROOT}

images/php/7.2-fpm/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# This file is automatically generated. Do not edit directly. #
22
FROM php:7.2-fpm
33

4+
ARG MAGENTO_ROOT=/app
5+
46
ENV PHP_MEMORY_LIMIT 2G
5-
ENV MAGENTO_ROOT /app
7+
ENV PHP_VALIDATE_TIMESTAMPS 1
68
ENV DEBUG false
79
ENV MAGENTO_RUN_MODE production
810
ENV UPLOAD_MAX_FILESIZE 64M
9-
ENV ENABLE_SENDMAIL true
11+
ENV SENDMAIL_PATH /dev/null
12+
ENV PHPRC ${MAGENTO_ROOT}/php.ini
1013

1114
ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sysvmsg sysvsem sysvshm xsl zip pcntl
1215

images/php/7.2-fpm/docker-entrypoint.sh

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,16 @@
44

55
PHP_EXT_DIR=/usr/local/etc/php/conf.d
66

7-
# Configure Sendmail if required
8-
if [ "$ENABLE_SENDMAIL" == "true" ]; then
9-
sed -i "s/!SENDMAIL_PATH!/\"\/usr\/local\/bin\/mhsendmail --smtp-addr=mailhog:1025\"/" ${PHP_EXT_DIR}/zz-mail.ini
10-
else
11-
sed -i "s/!SENDMAIL_PATH!/\"true > \/dev\/null\"/" ${PHP_EXT_DIR}/zz-mail.ini
12-
fi
13-
14-
# Substitute in php.ini values
15-
[ ! -z "${PHP_MEMORY_LIMIT}" ] && sed -i "s/!PHP_MEMORY_LIMIT!/${PHP_MEMORY_LIMIT}/" ${PHP_EXT_DIR}/zz-magento.ini
16-
[ ! -z "${UPLOAD_MAX_FILESIZE}" ] && sed -i "s/!UPLOAD_MAX_FILESIZE!/${UPLOAD_MAX_FILESIZE}/" ${PHP_EXT_DIR}/zz-magento.ini
17-
18-
# Add custom php.ini if it exists
19-
[ -f "/app/php.ini" ] && cp /app/php.ini ${PHP_EXT_DIR}/zzz-custom-php.ini
20-
21-
# Add developer php.ini if it exists
22-
[ -f "/app/php.dev.ini" ] && [ "$MAGENTO_RUN_MODE" == "developer" ] && cp /app/php.dev.ini ${PHP_EXT_DIR}/zzz-dev-php.ini
23-
247
# Enable PHP extensions
258
PHP_EXT_COM_ON=docker-php-ext-enable
269

2710
[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini
2811

2912
if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then
30-
${PHP_EXT_COM_ON} ${PHP_EXTENSIONS}
13+
${PHP_EXT_COM_ON} ${PHP_EXTENSIONS}
3114
fi
3215

33-
# Configure PHP-FPM
34-
[ ! -z "${MAGENTO_RUN_MODE}" ] && sed -i "s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE}/" /usr/local/etc/php-fpm.conf
35-
36-
# Set host.docker.inernal if not available
16+
# Set host.docker.internal if not available
3717
HOST_NAME="host.docker.internal"
3818
HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');")
3919
if [[ "$HOST_IP" == "$HOST_NAME" ]]; then

images/php/7.2-fpm/etc/mail.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
; Sendmail
2-
sendmail_path=!SENDMAIL_PATH!
2+
sendmail_path = ${SENDMAIL_PATH}

images/php/7.2-fpm/etc/php-fpm.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ pm.min_spare_servers = 2
1717
pm.max_spare_servers = 6
1818
pm.status_path = /status
1919

20-
env[MAGE_MODE] = !MAGENTO_RUN_MODE!; # Variable: MAGENTO_RUN_MODE
21-
2220
clear_env = no
2321

22+
env[MAGE_MODE] = $MAGENTO_RUN_MODE
23+
2424
; Ensure worker stdout and stderr are sent to the main error log.
2525
catch_workers_output = yes

0 commit comments

Comments
 (0)