Skip to content

Commit f8e38e7

Browse files
thisismeonmounteverestthisismeonmounteverest
andauthored
Move to Frankenphp. Fix deprecation messages in actions. (#386)
* Add CI steps to create database. * Create MariaDB and test database as part of the test workflow. * Update ci.yml * Update .env.test * Update ci.yml * Update ci.yml * Install dependencies and run encore to create needed files for integration tests. * Update ci.yml * Update ci.yml * Update ci.yml * Updating ci.yml to use * Updating ci.yml to use * Updating ci.yml to use $GITHUB_OUTPUT * Updating ci.yml to use $GITHUB_OUTPUT * Updating ci.yml to use $GITHUB_OUTPUT * Ignore SignupController for infection (mutating integration tests is meaningless). * Enabling infection run. * Update ci.yml * Update ci.yml * Update infection.json5.dist * Update ci.yml * Bump versions. * Moving docker setup from nginx and php to Frankenphp. --------- Co-authored-by: thisismeonmounteverest <shevek@blafaselblubb.abcde.biz>
1 parent d45ecf0 commit f8e38e7

File tree

13 files changed

+529
-2594
lines changed

13 files changed

+529
-2594
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Here is a sample: https://gist.github.com/vincentchalamon/d5defad563ed49d9306a4aa57dfd4498
33
errors.log
44
rox_local.ini
5+
.php-version
56
*.cache.ini
67
.php_cs.cache
78
.php-cs-fixer.cache
@@ -59,6 +60,7 @@ allCountries.zip
5960
/public/bundles/
6061
/var/
6162
/vendor/
63+
/config/reference.php
6264
###< symfony/framework-bundle ###
6365
###> symfony/webpack-encore-bundle ###
6466
/node_modules/

.php-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

Dockerfile

Lines changed: 9 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
77
ARG PHP_VERSION=8.5
8-
ARG NGINX_VERSION=1.29
8+
ARG FRANKENPHP_VERSION=1.11
99

1010

1111
# "php" stage
12-
FROM php:${PHP_VERSION}-fpm-alpine AS bewelcome_php
12+
FROM dunglas/frankenphp:${FRANKENPHP_VERSION}-php${PHP_VERSION}-alpine AS bewelcome_php
1313

1414
# persistent / runtime deps
1515
RUN apk add --no-cache \
@@ -25,49 +25,19 @@ RUN apk add --no-cache \
2525
python3 \
2626
;
2727

28-
ARG APCU_VERSION=5.1.24
2928
RUN set -eux; \
30-
apk add --no-cache --virtual .build-deps \
31-
$PHPIZE_DEPS \
32-
freetype-dev \
33-
icu-dev \
34-
libjpeg-turbo-dev \
35-
libpng-dev \
36-
libxslt-dev \
37-
libzip-dev \
38-
zlib-dev \
39-
; \
40-
\
41-
docker-php-ext-configure zip; \
42-
docker-php-ext-configure gd --with-freetype --with-jpeg=/usr/include/ --enable-gd; \
43-
docker-php-ext-install -j$(nproc) \
29+
install-php-extensions \
30+
apcu \
4431
intl \
4532
gd \
4633
mysqli \
4734
pcntl \
4835
pdo_mysql \
4936
xsl \
5037
zip \
51-
exif \
52-
; \
53-
pecl install \
54-
apcu-${APCU_VERSION} \
55-
; \
56-
pecl clear-cache; \
57-
docker-php-ext-enable \
58-
apcu \
38+
exif \
5939
opcache \
60-
; \
61-
\
62-
runDeps="$( \
63-
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
64-
| tr ',' '\n' \
65-
| sort -u \
66-
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
67-
)"; \
68-
apk add --no-cache --virtual .phpexts-rundeps $runDeps; \
69-
\
70-
apk del .build-deps
40+
;
7141

7242
# https://github.com/nodejs/docker-node/issues/1126
7343
RUN set -eux; \
@@ -80,12 +50,6 @@ RUN export PATH="/usr/local/bin:$PATH"
8050
RUN ln -s $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini
8151
COPY docker/php/conf.d/bewelcome.prod.ini $PHP_INI_DIR/conf.d/bewelcome.ini
8252

83-
RUN set -eux; \
84-
{ \
85-
echo '[www]'; \
86-
echo 'ping.path = /ping'; \
87-
} | tee /usr/local/etc/php-fpm.d/docker-healthcheck.conf
88-
8953
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
9054
ENV COMPOSER_ALLOW_SUPERUSER=1
9155

@@ -143,27 +107,16 @@ RUN set -eux; \
143107
VOLUME /srv/bewelcome/var
144108
VOLUME /srv/bewelcome/data
145109

146-
COPY docker/php/docker-healthcheck.sh /usr/local/bin/docker-healthcheck
147-
RUN chmod +x /usr/local/bin/docker-healthcheck
110+
COPY docker/frankenphp/Caddyfile /etc/caddy/Caddyfile
148111

149-
HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD ["docker-healthcheck"]
112+
HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD ["frankenphp", "php-cli", "-r", "echo 1;"]
150113

151114
COPY docker/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
152115
RUN chmod +x /usr/local/bin/docker-entrypoint
153116

154117
ENTRYPOINT ["docker-entrypoint"]
155-
CMD ["php-fpm"]
156-
157-
158-
# "nginx" stage
159-
# depends on the "php" stage above
160-
FROM nginx:${NGINX_VERSION}-alpine AS bewelcome_nginx
161-
162-
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
163-
164-
WORKDIR /srv/bewelcome/public
118+
CMD ["frankenphp", "run", "--config", "/etc/caddy/Caddyfile"]
165119

166-
COPY --from=bewelcome_php /srv/bewelcome/public ./
167120

168121
# "php" dev stage
169122
# depends on the "php" stage above

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@
8989
"alexandresalome/mailcatcher": "^1.3",
9090
"behat/behat": "^3.7",
9191
"cmgmyr/phploc": "^8.0",
92-
"dama/doctrine-test-bundle": "8.*",
93-
"doctrine/data-fixtures": "2.*",
94-
"fakerphp/faker": "^v1.14.1",
92+
"dama/doctrine-test-bundle": "^8.0",
93+
"doctrine/data-fixtures": "^2.0",
94+
"fakerphp/faker": "^v1.14",
9595
"friends-of-behat/mink": "^1.8",
9696
"friends-of-behat/mink-browserkit-driver": "^1.4",
9797
"friends-of-behat/mink-extension": "^2.4",

0 commit comments

Comments
 (0)