Skip to content

Commit 8ab4c7d

Browse files
committed
Merge branch 'php7dot4' into php8dot0
2 parents a892e17 + eda105b commit 8ab4c7d

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ ENV XDEBUG_REMOTE_PORT=9000
2121
ENV PHP_EXTENSION_WDDX=1
2222
ENV PHP_OPENSSL=1
2323

24+
ENV CONTAINER_STARTED_LOCK=/var/lock/container.started
25+
2426
RUN apt-get update && apt-get install -y --no-install-recommends wget vim supervisor libfreetype6-dev libjpeg-dev libjpeg62-turbo-dev \
2527
libmcrypt-dev libpng-dev libssl-dev libaio1 git libcurl4-openssl-dev libxslt-dev \
2628
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
8991
COPY apache-run.sh /usr/bin/apache-run
9092
COPY ./bin /usr/bin/
9193

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
9398

9499
USER www-data
95100

apache-run.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
#!/bin/bash
22

3+
set -e
4+
5+
rm -f $CONTAINER_STARTED_LOCK
6+
37
if [[ ${XDEBUG_ENABLED} == true ]]; then
48
sudo -E xdebug-set-mode ${XDEBUG_MODE:-debug}
59
fi
610

711
sudo -E newrelic-setup
12+
sudo -E opcache-setup
813

914
if [[ ${SESSION_HANDLER} == true ]]; then
1015
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/* &&
1924
sudo chown -R www-data:www-data /var/www/html/var/logs && chmod 777 /var/www/html/var/logs &&
2025
sudo chown -R www-data:www-data /var/www/html/var/sessions && chmod 777 /var/www/html/var/sessions
2126

27+
post-startup-hook
28+
29+
touch $CONTAINER_STARTED_LOCK
30+
2231
exec apache2-foreground

bin/opcache-setup

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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

bin/wait-startup

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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."

0 commit comments

Comments
 (0)