Skip to content

Commit 56bbe06

Browse files
committed
feat: add new php8latest to the matrix
Identical 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 ```
1 parent 841489e commit 56bbe06

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-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.4-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 "$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"]

0 commit comments

Comments
 (0)