File tree Expand file tree Collapse file tree 4 files changed +33
-1
lines changed Expand file tree Collapse file tree 4 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 20
20
PHP_EXTENSION_WDDX=1 \
21
21
PHP_OPENSSL=1
22
22
23
+ ENV CONTAINER_STARTED_LOCK=/var/lock/container.started
24
+
23
25
RUN apt-get update && apt-get install -y --no-install-recommends wget vim supervisor libfreetype6-dev libjpeg-dev libjpeg62-turbo-dev \
24
26
libmcrypt-dev libpng-dev libssl-dev libaio1 git libcurl4-openssl-dev libxslt-dev \
25
27
libldap2-dev libicu-dev libc-client-dev libkrb5-dev libsqlite3-dev libedit-dev \
@@ -87,7 +89,10 @@ COPY configs/php-errors.ini /usr/local/etc/php/conf.d/php-errors.ini
87
89
COPY apache-run.sh /usr/bin/apache-run
88
90
COPY ./bin /usr/bin/
89
91
90
- RUN chmod a+x /usr/bin/apache-run /usr/bin/xdebug-set-mode
92
+ RUN touch /usr/bin/post-startup-hook && chmod a+x \
93
+ /usr/bin/apache-run \
94
+ /usr/bin/xdebug-set-mode \
95
+ /usr/bin/post-startup-hook
91
96
92
97
USER www-data
93
98
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ set -e
4
+
5
+ rm -f $CONTAINER_STARTED_LOCK
6
+
3
7
if [[ ${XDEBUG_ENABLED} == true ]]; then
4
8
sudo -E xdebug-set-mode ${XDEBUG_MODE:- debug}
5
9
fi
6
10
7
11
sudo -E newrelic-setup
12
+ sudo -E opcache-setup
8
13
9
14
if [[ ${SESSION_HANDLER} == true ]]; then
10
15
echo " session.save_handler = ${SESSION_HANDLER_NAME} " | sudo tee -a /usr/local/etc/php/conf.d/session-handler.ini
@@ -19,4 +24,8 @@ sudo rm -rf var/cache/* var/logs/* &&
19
24
sudo chown -R www-data:www-data /var/www/html/var/logs && chmod 777 /var/www/html/var/logs &&
20
25
sudo chown -R www-data:www-data /var/www/html/var/sessions && chmod 777 /var/www/html/var/sessions
21
26
27
+ post-startup-hook
28
+
29
+ touch $CONTAINER_STARTED_LOCK
30
+
22
31
exec apache2-foreground
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if [[ ${OPCACHE_ENABLED} == true ]]; then
4
+ echo " opcache.enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini
5
+ echo " opcache.max_accelerated_files=$( echo $[ 1000 + $( find . -type f -name " *.php" | wc -l) ]) " >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini
6
+ else
7
+ echo " opcache.enable=0" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini
8
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+
5
+ while [ ! -f $CONTAINER_STARTED_LOCK ]; do
6
+ echo " Esperando startup do container..."
7
+ sleep 5
8
+ done
9
+
10
+ echo " Startup do container concluída."
You can’t perform that action at this time.
0 commit comments