Skip to content

Commit d7786c3

Browse files
committed
feat: add new php8latest to the matrix
Similar Dockerfile as `php8`, but with root image using the latest current PHP version, which makes this a moving target. --- ```bash diff Dockerfile.php8 Dockerfile.php8latest ``` ```diff - FROM php:8.3-apache + FROM php:8.4-apache ``` ```diff - COPY ./php.ini-production "$PHP_INI_DIR/php.ini" + COPY ./php.ini-production.php8latest "$PHP_INI_DIR/php.ini" ``` --- PHP 8.5 deprecates a few PHP INI options and bundled Opcache without needing a separate toggle. To account for these changes, there is a separate INI file. These images are not meant to be used in production, but rather as a target to test the latest PHP version easily.
1 parent 841489e commit d7786c3

File tree

4 files changed

+332
-0
lines changed

4 files changed

+332
-0
lines changed

.github/workflows/production.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
php:
1919
- php7
2020
- php8
21+
- php8latest
2122

2223
steps:
2324
- name: GitHub Environment Variables Action

Dockerfile.php8latest

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
FROM php:8.5-rc-apache
2+
3+
EXPOSE 80
4+
5+
ENV APACHE_RUN_USER www-data
6+
ENV APACHE_RUN_GROUP www-data
7+
ENV APACHE_LOCK_DIR /var/lock/apache2
8+
ENV APACHE_LOG_DIR /var/log/apache2
9+
ENV APACHE_PID_FILE /var/run/apache2/apache2.pid
10+
ENV APACHE_SERVER_NAME php-docker-base-linkorb
11+
12+
COPY ./php.ini-production.php8latest "$PHP_INI_DIR/php.ini"
13+
14+
COPY ./apache2.conf /etc/apache2/apache2.conf
15+
COPY ./apache-vhost.conf /etc/apache2/sites-available/000-default.conf
16+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/bin/
17+
COPY --from=composer /usr/bin/composer /usr/bin/composer
18+
19+
RUN apt-get update \
20+
&& apt-get dist-upgrade -y \
21+
&& apt-get install -y --no-install-recommends \
22+
curl \
23+
git \
24+
gosu \
25+
iputils-ping \
26+
joe \
27+
jq \
28+
libbz2-dev \
29+
openssh-client \
30+
software-properties-common \
31+
telnet \
32+
unzip \
33+
vim \
34+
zip \
35+
ca-certificates \
36+
gnupg \
37+
tidy \
38+
wkhtmltopdf \
39+
pdftk \
40+
libxml2-dev \
41+
&& apt-get autoremove \
42+
&& apt-get clean \
43+
&& rm -rf /var/lib/apt/lists/*
44+
45+
46+
ENV NODE_MAJOR=20
47+
# Based on nodesource installation instructions https://github.com/nodesource/distributions#installation-instructions
48+
RUN mkdir -p /etc/apt/keyrings \
49+
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
50+
| gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
51+
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \
52+
&& apt-get update \
53+
&& apt-get install nodejs -y \
54+
&& apt-get autoremove \
55+
&& apt-get clean \
56+
&& rm -rf /var/lib/apt/lists/*
57+
58+
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg \
59+
| gpg --dearmor >> /usr/share/keyrings/yarnkey.gpg \
60+
&& echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list \
61+
&& apt-get update \
62+
&& apt-get install yarn \
63+
&& apt-get autoremove \
64+
&& apt-get clean \
65+
&& rm -rf /var/lib/apt/lists/*
66+
67+
RUN docker-php-ext-install bz2 \
68+
&& install-php-extensions apcu gd gmp intl opcache pdo_mysql pdo_pgsql sockets zip imap mailparse soap mysqli bcmath \
69+
&& apt-get autoremove \
70+
&& apt-get clean \
71+
&& rm -rf /var/lib/apt/lists/*
72+
73+
RUN mkdir -p /app/config/secrets/dev \
74+
&& mkdir -p /app/public/build \
75+
&& chown -R www-data:www-data /app \
76+
&& chown -R www-data:www-data /var/www \
77+
&& a2enmod rewrite \
78+
&& a2enmod headers
79+
80+
COPY --chown=www-data:www-data index.html /app
81+
82+
WORKDIR /app
83+
84+
USER root

Dockerfile.php8latest-review

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM ghcr.io/ayesh/php-docker-base:php8latest
2+
3+
RUN mkdir -p /opt
4+
5+
WORKDIR /opt/
6+
7+
# Do not run Composer as root/super user! See https://getcomposer.org/root for details
8+
# Aborting as no plugin should be loaded if running as super user is not explicitly allowed
9+
ENV COMPOSER_ALLOW_SUPERUSER=1
10+
11+
# install reviewdog
12+
RUN curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s
13+
RUN mv /opt/bin/reviewdog /usr/local/bin
14+
15+
RUN composer global require icanhazstring/composer-unused \
16+
&& ln -s /root/.config/composer/vendor/bin/composer-unused /usr/local/bin/composer-unused
17+
18+
RUN apt-get update && apt-get install -y python3-pip && python3 -m pip install yamllint --break-system-packages
19+
20+
# Caused the appearance of a git untracked index.html file within the GitHub codespace (when image used as
21+
# the base of a devcontainer)
22+
RUN rm /app/index.html
23+
24+
ENTRYPOINT ["apache2-foreground"]

php.ini-production.php8latest

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
[PHP]
2+
3+
;;;;;;;;;;;;;;;;;;;;
4+
; Language Options ;
5+
;;;;;;;;;;;;;;;;;;;;
6+
7+
engine = On
8+
short_open_tag = Off
9+
asp_tags = Off
10+
precision = 14
11+
output_buffering = 4096
12+
13+
zlib.output_compression = Off
14+
15+
implicit_flush = Off
16+
unserialize_callback_func =
17+
serialize_precision = 17
18+
disable_functions =
19+
20+
zend.enable_gc = On
21+
22+
;;;;;;;;;;;;;;;;;
23+
; Miscellaneous ;
24+
;;;;;;;;;;;;;;;;;
25+
26+
expose_php = Off
27+
28+
;;;;;;;;;;;;;;;;;;;
29+
; Resource Limits ;
30+
;;;;;;;;;;;;;;;;;;;
31+
32+
max_execution_time = 60
33+
max_input_time = 60
34+
max_input_vars = 1000
35+
memory_limit = 1024M
36+
37+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
38+
; Error handling and logging ;
39+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
40+
41+
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_WARNING
42+
display_errors = Off
43+
display_startup_errors = Off
44+
log_errors = On
45+
log_errors_max_len = 1024
46+
ignore_repeated_errors = Off
47+
ignore_repeated_source = Off
48+
track_errors = Off
49+
html_errors = On
50+
51+
;;;;;;;;;;;;;;;;;
52+
; Data Handling ;
53+
;;;;;;;;;;;;;;;;;
54+
55+
variables_order = "GPCS"
56+
request_order = "GP"
57+
register_argc_argv = Off
58+
auto_globals_jit = On
59+
60+
post_max_size = 32M
61+
auto_prepend_file =
62+
auto_append_file =
63+
64+
default_mimetype = "text/html"
65+
always_populate_raw_post_data = -1
66+
67+
;;;;;;;;;;;;;;;;;;;;;;;;;
68+
; Paths and Directories ;
69+
;;;;;;;;;;;;;;;;;;;;;;;;;
70+
71+
doc_root =
72+
user_dir =
73+
74+
enable_dl = Off
75+
76+
realpath_cache_size = 32K
77+
78+
;;;;;;;;;;;;;;;;
79+
; File Uploads ;
80+
;;;;;;;;;;;;;;;;
81+
82+
file_uploads = On
83+
upload_max_filesize = 64M
84+
max_file_uploads = 20
85+
86+
;;;;;;;;;;;;;;;;;;
87+
; Fopen wrappers ;
88+
;;;;;;;;;;;;;;;;;;
89+
90+
allow_url_fopen = On
91+
allow_url_include = Off
92+
93+
default_socket_timeout = 60
94+
95+
;;;;;;;;;;;;;;;;;;;
96+
; Module Settings ;
97+
;;;;;;;;;;;;;;;;;;;
98+
99+
[CLI Server]
100+
cli_server.color = On
101+
102+
[Date]
103+
date.timezone = Europe/Amsterdam
104+
105+
[Pdo_mysql]
106+
pdo_mysql.cache_size = 2000
107+
pdo_mysql.default_socket=
108+
109+
[mail function]
110+
; For Win32 only.
111+
SMTP = localhost
112+
smtp_port = 25
113+
114+
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
115+
sendmail_path = /usr/sbin/sendmail -t -i
116+
117+
mail.add_x_header = On
118+
119+
[SQL]
120+
sql.safe_mode = Off
121+
122+
[ODBC]
123+
odbc.allow_persistent = On
124+
odbc.check_persistent = On
125+
odbc.max_persistent = -1
126+
odbc.max_links = -1
127+
odbc.defaultlrl = 4096
128+
odbc.defaultbinmode = 1
129+
130+
[MySQL]
131+
mysql.allow_local_infile = On
132+
mysql.allow_persistent = On
133+
mysql.cache_size = 2000
134+
mysql.max_persistent = -1
135+
mysql.max_links = -1
136+
mysql.default_port =
137+
mysql.default_socket =
138+
mysql.default_host =
139+
mysql.default_user =
140+
mysql.default_password =
141+
mysql.connect_timeout = 60
142+
mysql.trace_mode = Off
143+
144+
[MySQLi]
145+
mysqli.max_persistent = -1
146+
mysqli.allow_persistent = On
147+
mysqli.max_links = -1
148+
mysqli.cache_size = 2000
149+
mysqli.default_port = 3306
150+
mysqli.default_socket =
151+
mysqli.default_host =
152+
mysqli.default_user =
153+
mysqli.default_pw =
154+
mysqli.reconnect = Off
155+
156+
[mysqlnd]
157+
mysqlnd.collect_statistics = On
158+
mysqlnd.collect_memory_statistics = Off
159+
160+
[PostgreSQL]
161+
pgsql.allow_persistent = On
162+
pgsql.auto_reset_persistent = Off
163+
pgsql.max_persistent = -1
164+
pgsql.max_links = -1
165+
pgsql.ignore_notice = 0
166+
pgsql.log_notice = 0
167+
168+
[bcmath]
169+
bcmath.scale = 0
170+
171+
[Session]
172+
session.save_handler = files
173+
session.save_path =
174+
session.use_cookies = 1
175+
session.use_only_cookies = 1
176+
session.name = SID
177+
session.auto_start = 0
178+
179+
session.cookie_lifetime = 0
180+
session.cookie_path = /
181+
session.cookie_domain =
182+
session.cookie_httponly =
183+
184+
session.serialize_handler = php
185+
186+
session.gc_probability = 1
187+
session.gc_divisor = 1000
188+
session.gc_maxlifetime = 2592000
189+
190+
session.bug_compat_42 = Off
191+
session.bug_compat_warn = Off
192+
session.referer_check =
193+
194+
session.cache_limiter = nocache
195+
session.cache_expire = 180
196+
197+
session.use_trans_sid = 0
198+
199+
session.hash_function = 1
200+
session.hash_bits_per_character = 5
201+
202+
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
203+
204+
[MSSQL]
205+
mssql.allow_persistent = On
206+
mssql.max_persistent = -1
207+
mssql.max_links = -1
208+
mssql.min_error_severity = 10
209+
mssql.min_message_severity = 10
210+
mssql.compatability_mode = Off
211+
mssql.secure_connection = Off
212+
213+
[Tidy]
214+
tidy.clean_output = Off
215+
216+
[soap]
217+
soap.wsdl_cache_enabled=1
218+
soap.wsdl_cache_dir="/tmp"
219+
soap.wsdl_cache_ttl=86400
220+
soap.wsdl_cache_limit = 5
221+
222+
[ldap]
223+
ldap.max_links = -1

0 commit comments

Comments
 (0)