Skip to content

Commit 731d320

Browse files
committed
php 8.4
1 parent a28b749 commit 731d320

File tree

20 files changed

+747
-260
lines changed

20 files changed

+747
-260
lines changed

.github/workflows/ci.yaml

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,31 @@ jobs:
3131
file: Dockerfile-7.4-apache
3232
tags: sarkedev/php:7.4-apache
3333

34-
docker_80:
34+
# docker_80:
35+
# runs-on: ubuntu-latest
36+
# steps:
37+
# -
38+
# name: Set up QEMU
39+
# uses: docker/setup-qemu-action@v1
40+
# -
41+
# name: Set up Docker Buildx
42+
# uses: docker/setup-buildx-action@v1
43+
# -
44+
# name: Login to DockerHub
45+
# uses: docker/login-action@v1
46+
# with:
47+
# username: ${{ secrets.DOCKERHUB_USERNAME }}
48+
# password: ${{ secrets.DOCKERHUB_TOKEN }}
49+
# -
50+
# name: Build and push 8.0
51+
# id: docker_build_80
52+
# uses: docker/build-push-action@v2
53+
# with:
54+
# push: true
55+
# file: Dockerfile-8.0-apache
56+
# tags: sarkedev/php:8.0-apache
57+
58+
docker_81:
3559
runs-on: ubuntu-latest
3660
steps:
3761
-
@@ -47,15 +71,15 @@ jobs:
4771
username: ${{ secrets.DOCKERHUB_USERNAME }}
4872
password: ${{ secrets.DOCKERHUB_TOKEN }}
4973
-
50-
name: Build and push 8.0
51-
id: docker_build_80
74+
name: Build and push 8.1
75+
id: docker_build_81
5276
uses: docker/build-push-action@v2
5377
with:
5478
push: true
55-
file: Dockerfile-8.0-apache
56-
tags: sarkedev/php:8.0-apache
79+
file: Dockerfile-8.1-apache
80+
tags: sarkedev/php:8.1-apache
5781

58-
docker_81:
82+
docker_84:
5983
runs-on: ubuntu-latest
6084
steps:
6185
-
@@ -71,10 +95,34 @@ jobs:
7195
username: ${{ secrets.DOCKERHUB_USERNAME }}
7296
password: ${{ secrets.DOCKERHUB_TOKEN }}
7397
-
74-
name: Build and push 8.1
75-
id: docker_build_81
98+
name: Build and push 8.4 Apache
99+
id: docker_build_84
76100
uses: docker/build-push-action@v2
77101
with:
78102
push: true
79-
file: Dockerfile-8.1-apache
80-
tags: sarkedev/php:8.1-apache
103+
file: Dockerfile-8.4-apache
104+
tags: sarkedev/php:8.4-apache
105+
106+
# docker_84_fpm:
107+
# runs-on: ubuntu-latest
108+
# steps:
109+
# -
110+
# name: Set up QEMU
111+
# uses: docker/setup-qemu-action@v1
112+
# -
113+
# name: Set up Docker Buildx
114+
# uses: docker/setup-buildx-action@v1
115+
# -
116+
# name: Login to DockerHub
117+
# uses: docker/login-action@v1
118+
# with:
119+
# username: ${{ secrets.DOCKERHUB_USERNAME }}
120+
# password: ${{ secrets.DOCKERHUB_TOKEN }}
121+
# -
122+
# name: Build and push 8.4 FPM
123+
# id: docker_build_84_fpm
124+
# uses: docker/build-push-action@v2
125+
# with:
126+
# push: true
127+
# file: Dockerfile-8.4-fpm
128+
# tags: sarkedev/php:8.4-fpm

Dockerfile-7.4-apache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
106106
# RUN a2enmod rewrite headers ssl
107107
RUN a2enmod rewrite headers
108108

109-
COPY copy /
109+
COPY copy/base /
110+
COPY copy/apache /
110111

111112
RUN curl -sfL git.io/antibody | sh -s - -b /usr/local/bin \
112113
&& antibody bundle < /root/.zsh_plugins.txt > /root/.zsh_plugins.sh \

Dockerfile-8.0-apache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
9494
# RUN a2enmod rewrite headers ssl
9595
RUN a2enmod rewrite headers
9696

97-
COPY copy /
97+
COPY copy/base /
98+
COPY copy/apache /
9899

99100
RUN zsh /root/setup.zsh
100101

Dockerfile-8.1-apache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
9494
# RUN a2enmod rewrite headers ssl
9595
RUN a2enmod rewrite headers
9696

97-
COPY copy /
97+
COPY copy/base /
98+
COPY copy/apache /
9899

99100
RUN curl -sfL git.io/antibody | sh -s - -b /usr/local/bin \
100101
&& antibody bundle < /root/.zsh_plugins.txt > /root/.zsh_plugins.sh \

Dockerfile-8.4-apache

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
FROM php:8.4-apache
2+
3+
ENV DEBIAN_FRONTEND=noninteractive \
4+
COMPOSER_ALLOW_SUPERUSER=1 \
5+
PHP_USER_ID=33 \
6+
PHP_ENABLE_XDEBUG=0 \
7+
PATH=/app:/app/vendor/bin:/root/.composer/vendor/bin:$PATH \
8+
TERM=linux
9+
10+
RUN set -ex \
11+
&& apt-get update \
12+
&& apt-get -y --no-install-recommends install \
13+
git curl apt-utils \
14+
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
15+
16+
RUN set -ex \
17+
&& apt-get update \
18+
&& apt-get -y --no-install-recommends install \
19+
rsync tar xz-utils dnsutils ssl-cert binutils \
20+
net-tools iproute2 \
21+
pv zsh \
22+
graphviz \
23+
# pdf
24+
ghostscript qpdf poppler-utils \
25+
# imap
26+
libc-client-dev libkrb5-dev \
27+
# webp and gd
28+
webp libwebp-dev libjpeg62-turbo-dev libpng-dev libxpm-dev libfreetype6-dev zlib1g-dev \
29+
# magic
30+
imagemagick libcurl3-dev libicu-dev libfreetype6-dev libjpeg-dev libjpeg62-turbo-dev libonig-dev libmagickwand-dev libpq-dev libpng-dev \
31+
# async
32+
libevent-dev libuv1-dev \
33+
# ssh2
34+
libssh2-1-dev \
35+
# other good stuff from yii2-docker
36+
libxml2-dev libxslt-dev libzip-dev zlib1g-dev default-mysql-client openssh-client nano unzip libcurl4-openssl-dev libssl-dev \
37+
# python3
38+
# python3 python3-pip python3-venv \
39+
&& chsh -s /usr/bin/zsh \
40+
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
41+
42+
RUN set -ex \
43+
&& docker-php-source extract \
44+
&& docker-php-ext-configure gd \
45+
--enable-gd \
46+
--with-freetype \
47+
--with-jpeg \
48+
--with-webp \
49+
&& docker-php-ext-install \
50+
gd \
51+
&& docker-php-ext-install \
52+
pcntl posix sockets ffi \
53+
soap zip curl bcmath exif \
54+
iconv intl mbstring opcache \
55+
pdo_mysql pdo_pgsql \
56+
xml xsl \
57+
&& rm -rf /tmp/* \
58+
&& docker-php-source delete
59+
60+
RUN set -ex \
61+
&& docker-php-source extract \
62+
&& pecl install \
63+
# event redis imagick igbinary ast xdebug swoole \
64+
imap redis imagick igbinary ast xdebug \
65+
&& docker-php-ext-enable \
66+
# event redis imagick igbinary ast \
67+
imap redis imagick igbinary ast \
68+
&& rm -rf /tmp/* \
69+
&& docker-php-source delete
70+
71+
# Ensure runtime and assets directories exist
72+
RUN mkdir -p /app/runtime /app/web/assets \
73+
&& chown -R www-data:www-data /app/runtime /app/web/assets \
74+
&& chmod -R 775 /app/runtime /app/web/assets
75+
76+
# RUN a2enmod rewrite headers ssl
77+
RUN a2enmod rewrite headers
78+
79+
COPY copy/base /
80+
COPY copy/apache /
81+
82+
# Add GITHUB_API_TOKEN support for composer
83+
RUN chmod 700 \
84+
/usr/local/bin/docker-php-entrypoint \
85+
/usr/local/bin/composer \
86+
# Install composer
87+
&& curl -sS https://getcomposer.org/installer | php -- \
88+
--filename=composer.phar \
89+
--install-dir=/usr/local/bin \
90+
&& composer clear-cache
91+
92+
WORKDIR /app

Dockerfile-8.4-fpm

Whitespace-only changes.

compose.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
2+
x-defaults:
3+
4+
default: &default
5+
restart: unless-stopped
6+
environment:
7+
PHP_ENABLE_XDEBUG: 0
8+
# ports:
9+
# - "80:80"
10+
volumes:
11+
- "/home/peter/github:/app"
12+
extra_hosts:
13+
- "host.docker.internal:172.17.0.1"
14+
15+
services:
16+
php74:
17+
<<: *default
18+
build:
19+
context: .
20+
dockerfile: Dockerfile-7.4-apache
21+
image: 'sarkedev/php:7.4-apache'
22+
container_name: php74
23+
24+
# php80:
25+
# <<: *default
26+
# build:
27+
# context: .
28+
# dockerfile: Dockerfile-8.0-apache
29+
# image: 'sarkedev/php:8.0-apache'
30+
# container_name: php80
31+
32+
php81:
33+
<<: *default
34+
build:
35+
context: .
36+
dockerfile: Dockerfile-8.1-apache
37+
image: 'sarkedev/php:8.1-apache'
38+
container_name: php81
39+
40+
github-php74:
41+
<<: *default
42+
build:
43+
context: .
44+
dockerfile: Dockerfile-7.4-apache
45+
image: 'ghcr.io/sarkedev/php:7.4-apache'
46+
container_name: php74
47+
48+
github-php81:
49+
<<: *default
50+
build:
51+
context: .
52+
dockerfile: Dockerfile-8.1-apache
53+
image: 'ghcr.io/sarke/php:8.1-apache'
54+
container_name: php81
55+
56+
github-php84:
57+
<<: *default
58+
build:
59+
context: .
60+
dockerfile: Dockerfile-8.4-apache
61+
image: 'ghcr.io/sarke/php:8.4-apache'
62+
container_name: php84
63+
64+
github-php84-fpm:
65+
<<: *default
66+
build:
67+
context: .
68+
dockerfile: Dockerfile-8.4-fpm
69+
image: 'ghcr.io/sarke/php:8.4-fpm'
70+
container_name: php84-fpm
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
<VirtualHost *:80>
3+
# The ServerName directive sets the request scheme, hostname and port that
4+
# the server uses to identify itself. This is used when creating
5+
# redirection URLs. In the context of virtual hosts, the ServerName
6+
# specifies what hostname must appear in the request's Host: header to
7+
# match this virtual host. For the default virtual host (this file) this
8+
# value is not decisive as it is used as a last resort host regardless.
9+
# However, you must set it for any further virtual host explicitly.
10+
#ServerName www.example.com
11+
12+
ServerAdmin webmaster@localhost
13+
DocumentRoot /app/web
14+
15+
<Directory /app/web/>
16+
Options Indexes FollowSymLinks
17+
AllowOverride All
18+
Require all granted
19+
</Directory>
20+
21+
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
22+
# error, crit, alert, emerg.
23+
# It is also possible to configure the loglevel for particular
24+
# modules, e.g.
25+
#LogLevel info ssl:warn
26+
27+
# ErrorLog ${APACHE_LOG_DIR}/error.log
28+
# CustomLog ${APACHE_LOG_DIR}/access.log combined
29+
30+
LogLevel info ssl:warn
31+
ErrorLog /proc/self/fd/2
32+
CustomLog /proc/self/fd/1 combined
33+
34+
# For most configuration files from conf-available/, which are
35+
# enabled or disabled at a global level, it is possible to
36+
# include a line for only one particular virtual host. For example the
37+
# following line enables the CGI configuration for this host only
38+
# after it has been globally disabled with "a2disconf".
39+
#Include conf-available/serve-cgi-bin.conf
40+
</VirtualHost>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Set permissions based on ENV variable (debian only)
5+
if [ -x "$(command -v usermod)" ] ; then
6+
usermod -u ${PHP_USER_ID} www-data
7+
fi
8+
9+
if [ 0 -ne "${PHP_ENABLE_SWOOLE:-0}" ] ; then
10+
docker-php-ext-enable swoole
11+
docker-php-ext-disable xdebug
12+
docker-php-ext-disable blackfire
13+
echo "swoole: on"
14+
echo "xdebug: off"
15+
echo "blackfire: off"
16+
else
17+
echo "swoole: off"
18+
19+
if [ 0 -ne "${PHP_ENABLE_XDEBUG:-0}" ] ; then
20+
docker-php-ext-enable xdebug
21+
echo "xdebug: on"
22+
else
23+
echo "xdebug: off"
24+
fi
25+
26+
if [ 0 -ne "${PHP_ENABLE_BLACKFIRE:-0}" ] ; then
27+
docker-php-ext-enable blackfire
28+
echo "blackfire: on"
29+
else
30+
echo "blackfire: off"
31+
fi
32+
fi
33+
34+
# first arg is `-f` or `--some-option`
35+
if [ "${1#-}" != "$1" ]; then
36+
if [ -x "$(command -v apache2-foreground)" ]; then
37+
set -- apache2-foreground "$@"
38+
else
39+
set -- php "$@"
40+
fi
41+
fi
42+
43+
exec "$@"
File renamed without changes.

0 commit comments

Comments
 (0)