Skip to content

Commit 7e037a4

Browse files
committed
merge develop branch
2 parents 746f041 + 133c38e commit 7e037a4

File tree

4 files changed

+53
-57
lines changed

4 files changed

+53
-57
lines changed

Dockerfile

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
# Metadata as defined at http://label-schema.org
44
LABEL org.label-schema.name="Apache Docker" \
@@ -21,29 +21,31 @@ RUN apt-get update && apt-get install -y locales && locale-gen ${OS_LOCALE}
2121

2222
# Install required packages
2323
RUN apt-get install -y \
24-
software-properties-common \
25-
python3.7 \
24+
software-properties-common
25+
26+
# Install additional packages from PPA
27+
RUN add-apt-repository -y ppa:ondrej/php \
28+
&& add-apt-repository -y ppa:deadsnakes/ppa \
29+
&& apt-get update && apt-get install -y
30+
31+
RUN apt-get install -y \
32+
python3.8 \
2633
curl \
2734
unzip \
2835
p7zip-full \
2936
apache2 \
3037
libsasl2-modules \
31-
libapache2-mod-php7.4 \
3238
libmcrypt-dev \
33-
php7.4-cli \
34-
php7.4-dev \
35-
php7.4-readline \
36-
php7.4-mbstring \
37-
php7.4-zip \
38-
php7.4-intl \
39-
php7.4-xml \
40-
php7.4-bcmath \
41-
php7.4-xmlrpc \
42-
php7.4-json \
43-
php7.4-curl \
44-
php7.4-gd \
45-
php7.4-pgsql \
46-
php7.4-mysql \
39+
libapache2-mod-php8.3 \
40+
php-pear \
41+
php8.3 \
42+
php8.3-cli \
43+
php8.3-bz2 \
44+
php8.3-curl \
45+
php8.3-mbstring \
46+
php8.3-intl \
47+
php8.3-fpm \
48+
php-dev \
4749
git \
4850
cron \
4951
ghostscript \
@@ -64,14 +66,9 @@ RUN apt-get install -y \
6466
&& apt-get clean \
6567
&& rm -rf /var/lib/apt/lists/*
6668

67-
# Install additional packages from PPA
68-
RUN add-apt-repository -y ppa:ondrej/php \
69-
&& add-apt-repository -y ppa:deadsnakes/ppa \
70-
&& apt-get update && apt-get install -y
71-
7269
# Install and configure pecl extensions
7370
RUN pecl channel-update pecl.php.net \
74-
&& pecl install mcrypt-1.0.3 \
71+
&& pecl install mcrypt-1.0.7 \
7572
&& pecl install redis -y
7673

7774
# Enable Apache mods.
@@ -87,10 +84,9 @@ RUN chmod -R 755 /opt/* \
8784
&& cp /opt/app/supervisord /etc/supervisor/conf.d/supervisord.conf
8885

8986
# Install Mod_pagespeed Module
90-
RUN curl -O https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb \
91-
&& dpkg -i mod-pagespeed-stable_current_amd64.deb \
87+
RUN dpkg -i /opt/app/mod-pagespeed-stable_current_amd64.deb \
9288
&& chown nobody:www-data /var/cache/mod_pagespeed \
93-
&& chown nobody:www-data /var/log/pagespeed/
89+
&& chown nobody:www-data /var/log/pagespeed
9490

9591
# Composer v2 installation
9692
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
7.92 MB
Binary file not shown.

app/run.sh

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -73,61 +73,61 @@ fi
7373
# Route mail to SMTP queuing servers
7474
#
7575
#####
76-
if [ ! -f /etc/php/7.4/apache2/build ]; then
76+
if [ ! -f /etc/php/8.3/apache2/build ]; then
7777

7878
# Tweak Apache Build
79-
sed -i 's|;include_path = ".:/usr/share/php"|include_path = ".:/usr/share/php:/data/pear"|g' /etc/php/7.4/apache2/php.ini
80-
sed -i 's/variables_order.*/variables_order = \"EGPCS\"/g' /etc/php/7.4/apache2/php.ini
79+
sed -i 's|;include_path = ".:/usr/share/php"|include_path = ".:/usr/share/php:/data/pear"|g' /etc/php/8.3/apache2/php.ini
80+
sed -i 's/variables_order.*/variables_order = \"EGPCS\"/g' /etc/php/8.3/apache2/php.ini
8181
sed -i 's/IncludeOptional sites-enabled\/\*.conf/IncludeOptional \/data\/apache2\/sites-enabled\/*.conf/' /etc/apache2/apache2.conf
82-
sed -i 's|;error_log = php_errors.log|error_log = /data/apache2/logs/error_log|g' /etc/php/7.4/apache2/php.ini
83-
echo "extension=mcrypt.so" > /etc/php/7.4/apache2/conf.d/mcrypt.ini
82+
sed -i 's|;error_log = php_errors.log|error_log = /data/apache2/logs/error_log|g' /etc/php/8.3/apache2/php.ini
83+
echo "extension=mcrypt.so" > /etc/php/8.3/apache2/conf.d/mcrypt.ini
8484

8585
# Setup Redis
86-
echo "extension=redis.so" > /etc/php/7.4/mods-available/redis.ini
87-
ln -sf /etc/php/7.4/mods-available/redis.ini /etc/php/7.4/cli/conf.d/20-redis.ini
88-
ln -sf /etc/php/7.4/mods-available/redis.ini /etc/php/7.4/apache2/conf.d/20-redis.ini
86+
echo "extension=redis.so" > /etc/php/8.3/mods-available/redis.ini
87+
ln -sf /etc/php/8.3/mods-available/redis.ini /etc/php/8.3/cli/conf.d/20-redis.ini
88+
ln -sf /etc/php/8.3/mods-available/redis.ini /etc/php/8.3/apache2/conf.d/20-redis.ini
8989

9090
# Update the PHP.ini file, enable <? ?> tags
91-
sed -i 's|short_open_tag = Off|short_open_tag = On|g' /etc/php/7.4/apache2/php.ini
91+
sed -i 's|short_open_tag = Off|short_open_tag = On|g' /etc/php/8.3/apache2/php.ini
9292

9393
# Sessions & garbage collection
94-
sed -i 's|;session.save_path = "/var/lib/php5"|session.save_path = "/tmp"|g' /etc/php/7.4/apache2/php.ini
95-
sed -i 's|session.gc_probability = 0|session.gc_probability = 1|g' /etc/php/7.4/apache2/php.ini
94+
sed -i 's|;session.save_path = "/var/lib/php5"|session.save_path = "/tmp"|g' /etc/php/8.3/apache2/php.ini
95+
sed -i 's|session.gc_probability = 0|session.gc_probability = 1|g' /etc/php/8.3/apache2/php.ini
9696

9797
# Update Apache / PHP Config
98-
sed -i 's|max_execution_time = 30|max_execution_time = 300|g' /etc/php/7.4/apache2/php.ini
99-
sed -i 's|memory_limit = 128M|memory_limit = -1|g' /etc/php/7.4/apache2/php.ini
100-
sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 1000M|g' /etc/php/7.4/apache2/php.ini
101-
sed -i 's|post_max_size = 8M|post_max_size = 1000M|g' /etc/php/7.4/apache2/php.ini
102-
sed -i 's|max_input_time = 60|max_input_time = 300|g' /etc/php/7.4/apache2/php.ini
98+
sed -i 's|max_execution_time = 30|max_execution_time = 300|g' /etc/php/8.3/apache2/php.ini
99+
sed -i 's|memory_limit = 128M|memory_limit = -1|g' /etc/php/8.3/apache2/php.ini
100+
sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 1000M|g' /etc/php/8.3/apache2/php.ini
101+
sed -i 's|post_max_size = 8M|post_max_size = 1000M|g' /etc/php/8.3/apache2/php.ini
102+
sed -i 's|max_input_time = 60|max_input_time = 300|g' /etc/php/8.3/apache2/php.ini
103103

104104
# Update CLI Config
105-
sed -i 's|memory_limit = 128M|memory_limit = -1|g' /etc/php/7.4/cli/php.ini
106-
sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 1000M|g' /etc/php/7.4/cli/php.ini
107-
sed -i 's|post_max_size = 8M|post_max_size = 1000M|g' /etc/php/7.4/cli/php.ini
105+
sed -i 's|memory_limit = 128M|memory_limit = -1|g' /etc/php/8.3/cli/php.ini
106+
sed -i 's|upload_max_filesize = 2M|upload_max_filesize = 1000M|g' /etc/php/8.3/cli/php.ini
107+
sed -i 's|post_max_size = 8M|post_max_size = 1000M|g' /etc/php/8.3/cli/php.ini
108108

109109

110110
# Add build file to remove duplicate script execution
111-
echo 1 > /etc/php/7.4/apache2/build
111+
echo 1 > /etc/php/8.3/apache2/build
112112

113113
if [[ -z "${NODE_ENVIRONMENT}" ]]; then
114114
# $NODE_ENVIRONMENT is set on container creation
115115
echo " env NODE_ENVIRONMENT is not set, Apache is not configured correctly."
116116
else
117117
if [ "$NODE_ENVIRONMENT" == 'dev' ]; then
118118
# Tweak Apache build
119-
sed -i 's|\[PHP\]|\[PHP\] \nIS_LIVE=0 \nIS_DEV=1 \nNODE_ENVIRONMENT=dev \n;The IS_DEV is set for testing outside of DEV environments ie: test.domain.tld|g' /etc/php/7.4/apache2/php.ini
119+
sed -i 's|\[PHP\]|\[PHP\] \nIS_LIVE=0 \nIS_DEV=1 \nNODE_ENVIRONMENT=dev \n;The IS_DEV is set for testing outside of DEV environments ie: test.domain.tld|g' /etc/php/8.3/apache2/php.ini
120120
# Log errors into log files
121-
sed -i 's/error_reporting = .*$/error_reporting = E_ALL/' /etc/php/7.4/apache2/php.ini
121+
sed -i 's/error_reporting = .*$/error_reporting = E_ALL/' /etc/php/8.3/apache2/php.ini
122122
# Default is 1024 and 0 allows to not apply any maximum length at all
123-
sed -i 's|log_errors_max_len = 1024|log_errors_max_len = 0|g' /etc/php/7.4/apache2/php.ini
123+
sed -i 's|log_errors_max_len = 1024|log_errors_max_len = 0|g' /etc/php/8.3/apache2/php.ini
124124
fi
125125

126126
if [ "$NODE_ENVIRONMENT" == 'production' ]; then
127127
# Tweak Apache build
128-
sed -i 's|\[PHP\]|\[PHP\] \nIS_LIVE=1 \nIS_DEV=0 \nNODE_ENVIRONMENT=production \n;The IS_DEV is set for testing outside of DEV environments ie: test.domain.tld|g' /etc/php/7.4/apache2/php.ini
128+
sed -i 's|\[PHP\]|\[PHP\] \nIS_LIVE=1 \nIS_DEV=0 \nNODE_ENVIRONMENT=production \n;The IS_DEV is set for testing outside of DEV environments ie: test.domain.tld|g' /etc/php/8.3/apache2/php.ini
129129
# Log errors into log files
130-
sed -i 's/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/' /etc/php/7.4/apache2/php.ini
130+
sed -i 's/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/' /etc/php/8.3/apache2/php.ini
131131
fi
132132

133133
fi

tests/build_tests.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ testCLI_max_input_time()
135135

136136
testApache_max_execution_time()
137137
{
138-
max_execution_time=$(cat /etc/php/7.4/apache2/php.ini | grep 'max_execution_time')
138+
max_execution_time=$(cat /etc/php/8.3/apache2/php.ini | grep 'max_execution_time')
139139
echo 'Test max_execution_time, currently set to "'$max_execution_time'"'
140140
test=$(echo $max_execution_time | grep 'max_execution_time = 300' | wc -l)
141141
assertEquals 1 $test
@@ -144,7 +144,7 @@ testApache_max_execution_time()
144144

145145
testApache_MemoryLimit()
146146
{
147-
memory_limit=$(cat /etc/php/7.4/apache2/php.ini | grep 'memory_limit')
147+
memory_limit=$(cat /etc/php/8.3/apache2/php.ini | grep 'memory_limit')
148148
echo 'Test memory_limit, currently set to "'$memory_limit'"'
149149
test=$(echo $memory_limit | grep 'memory_limit = -1' | wc -l)
150150
assertEquals 1 $test
@@ -153,7 +153,7 @@ testApache_MemoryLimit()
153153

154154
testApache_upload_max_filesize()
155155
{
156-
upload_max_filesize=$(cat /etc/php/7.4/apache2/php.ini | grep 'upload_max_filesize')
156+
upload_max_filesize=$(cat /etc/php/8.3/apache2/php.ini | grep 'upload_max_filesize')
157157
echo 'Test upload_max_filesize, currently set to "'$upload_max_filesize'"'
158158
test=$(echo $upload_max_filesize | grep 'upload_max_filesize = 1000M' | wc -l)
159159
assertEquals 1 $test
@@ -162,7 +162,7 @@ testApache_upload_max_filesize()
162162

163163
testApache_post_max_size()
164164
{
165-
post_max_size=$(cat /etc/php/7.4/apache2/php.ini | grep 'post_max_size')
165+
post_max_size=$(cat /etc/php/8.3/apache2/php.ini | grep 'post_max_size')
166166
echo 'Test post_max_size, currently set to "'$post_max_size'"'
167167
test=$(echo $post_max_size | grep 'post_max_size = 1000M' | wc -l)
168168
assertEquals 1 $test
@@ -171,7 +171,7 @@ testApache_post_max_size()
171171

172172
testApache_max_input_time()
173173
{
174-
max_input_time=$(cat /etc/php/7.4/apache2/php.ini | grep 'max_input_time')
174+
max_input_time=$(cat /etc/php/8.3/apache2/php.ini | grep 'max_input_time')
175175
echo 'Test max_input_time, currently set to "'$max_input_time'"'
176176
test=$(echo $max_input_time | grep 'max_input_time = 300' | wc -l)
177177
assertEquals 1 $test

0 commit comments

Comments
 (0)