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 @@ -21,6 +21,8 @@ ENV XDEBUG_REMOTE_PORT=9000
21
21
ENV PHP_EXTENSION_WDDX=1
22
22
ENV PHP_OPENSSL=1
23
23
24
+ ENV CONTAINER_STARTED_LOCK=/var/lock/container.started
25
+
24
26
RUN apt-get update && apt-get install -y --no-install-recommends wget vim supervisor libfreetype6-dev libjpeg-dev libjpeg62-turbo-dev \
25
27
libmcrypt-dev libpng-dev libssl-dev libaio1 git libcurl4-openssl-dev libxslt-dev \
26
28
libldap2-dev libicu-dev libc-client-dev libkrb5-dev libsqlite3-dev libedit-dev \
@@ -89,7 +91,10 @@ COPY configs/php-errors.ini /usr/local/etc/php/conf.d/php-errors.ini
89
91
COPY apache-run.sh /usr/bin/apache-run
90
92
COPY ./bin /usr/bin/
91
93
92
- RUN chmod a+x /usr/bin/apache-run /usr/bin/xdebug-set-mode
94
+ RUN touch /usr/bin/post-startup-hook && chmod a+x \
95
+ /usr/bin/apache-run \
96
+ /usr/bin/xdebug-set-mode \
97
+ /usr/bin/post-startup-hook
93
98
94
99
USER www-data
95
100
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