Skip to content

Commit

Permalink
Update frankenphp
Browse files Browse the repository at this point in the history
  • Loading branch information
Coderberg committed Jul 9, 2024
1 parent ba6d0c8 commit c8767b4
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 35 deletions.
32 changes: 17 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#syntax=docker/dockerfile:1.4

# Versions
FROM dunglas/frankenphp:1-alpine AS frankenphp_upstream
FROM dunglas/frankenphp:1-php8.3 AS frankenphp_upstream

# The different stages of this Dockerfile are meant to be built into separate images
# https://docs.docker.com/develop/develop-images/multistage-build/#stop-at-a-specific-build-stage
Expand All @@ -13,14 +13,16 @@ FROM frankenphp_upstream AS frankenphp_base

WORKDIR /app

VOLUME /app/var/

# persistent / runtime deps
# hadolint ignore=DL3018
RUN apk add --no-cache \
acl \
file \
gettext \
git \
;
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
acl \
file \
gettext \
git \
&& rm -rf /var/lib/apt/lists/*

RUN set -eux; \
install-php-extensions \
Expand All @@ -41,15 +43,16 @@ ENV COMPOSER_ALLOW_SUPERUSER=1
ENV PANTHER_NO_SANDBOX 1
# Not mandatory, but recommended
ENV PANTHER_CHROME_ARGUMENTS='--disable-dev-shm-usage'
RUN apk add --no-cache chromium chromium-chromedriver
RUN apt-get update && apt-get install -y --no-install-recommends chromium chromium-driver && rm -rf /var/lib/apt/lists/*

# Firefox and geckodriver
#ARG GECKODRIVER_VERSION=0.29.0
#RUN apk add --no-cache firefox
#RUN wget -q https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz; \
# tar -zxf geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz -C /usr/bin; \
# rm geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz
#ARG GECKODRIVER_VERSION=0.34.0
#RUN apt-get update && apt-get install -y --no-install-recommends firefox && rm -rf /var/lib/apt/lists/*
#RUN wget -q https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-aarch64.tar.gz; \
# tar -zxf geckodriver-v$GECKODRIVER_VERSION-aarch64.tar.gz -C /usr/bin; \
# rm geckodriver-v$GECKODRIVER_VERSION-aarch64.tar.gz
###< symfony/panther ###

###> doctrine/doctrine-bundle ###
RUN install-php-extensions pdo_mysql
###< doctrine/doctrine-bundle ###
Expand All @@ -68,7 +71,6 @@ CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile" ]
FROM frankenphp_base AS frankenphp_dev

ENV APP_ENV=dev XDEBUG_MODE=off
VOLUME /app/var/

RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

Expand Down
7 changes: 5 additions & 2 deletions compose.override.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ services:
###< doctrine/doctrine-bundle ###

###> symfony/mailer ###
mailhog:
image: mailhog/mailhog
mailer:
image: axllent/mailpit
ports:
- "1025:1025"
- "8025:8025"
environment:
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
###< symfony/mailer ###
4 changes: 2 additions & 2 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ services:
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
TRUSTED_PROXIES: ${TRUSTED_PROXIES:-127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16}
TRUSTED_HOSTS: ^${SERVER_NAME:-example\.com|localhost}|php$$
TRUSTED_HOSTS: ${TRUSTED_HOSTS:-^${SERVER_NAME:-example\.com|localhost}|php$$}
# Run "composer require symfony/orm-pack" to install and configure Doctrine ORM
DATABASE_URL: mysql://${MYSQL_USER:-app}:${MYSQL_PASSWORD:-!ChangeMe!}@mysql:3306/${MYSQL_DATABASE:-app}?serverVersion=${MYSQL_VERSION:-8.0.35}&charset=utf8mb4
# Run "composer require symfony/mercure-bundle" to install and configure the Mercure integration
MERCURE_URL: ${CADDY_MERCURE_URL:-http://php/.well-known/mercure}
MERCURE_PUBLIC_URL: https://${SERVER_NAME:-localhost}/.well-known/mercure
MERCURE_PUBLIC_URL: ${CADDY_MERCURE_PUBLIC_URL:-https://${SERVER_NAME:-localhost}/.well-known/mercure}
MERCURE_JWT_SECRET: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
# The two next lines can be removed after initial installation
SYMFONY_VERSION: ${SYMFONY_VERSION:-}
Expand Down
2 changes: 1 addition & 1 deletion docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ docker compose exec -T php bin/phpunit
Additional services:

- PhpMyAdmin http://localhost:8081
- MailHog http://localhost:8025
- Mailpit http://localhost:8025

See more detailed documentation here https://github.com/dunglas/symfony-docker
12 changes: 2 additions & 10 deletions frankenphp/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
frankenphp {
{$FRANKENPHP_CONFIG}
}

# https://caddyserver.com/docs/caddyfile/directives#sorting-algorithm
order mercure after encode
order vulcain after reverse_proxy
order php_server before file_server
}

{$CADDY_EXTRA_CONFIG}
Expand All @@ -17,11 +12,8 @@
log {
# Redact the authorization query parameter that can be set by Mercure
format filter {
wrap console
fields {
uri query {
replace authorization REDACTED
}
request>uri query {
replace authorization REDACTED
}
}
}
Expand Down
1 change: 0 additions & 1 deletion frankenphp/conf.d/app.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
variables_order = EGPCS
expose_php = 0
date.timezone = UTC
apc.enable_cli = 1
Expand Down
2 changes: 1 addition & 1 deletion frankenphp/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
fi

if [ "$( find ./migrations -iname '*.php' -print -quit )" ]; then
php bin/console doctrine:migrations:migrate --no-interaction
php bin/console doctrine:migrations:migrate --no-interaction --all-or-nothing
fi
fi

Expand Down
6 changes: 3 additions & 3 deletions symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@
]
},
"symfony/mailer": {
"version": "6.4",
"version": "7.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "4.3",
"ref": "2bf89438209656b85b9a49238c4467bff1b1f939"
"ref": "df66ee1f226c46f01e85c29c2f7acce0596ba35a"
},
"files": [
"config/packages/mailer.yaml"
Expand Down Expand Up @@ -240,7 +240,7 @@
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "1.0",
"ref": "292a3236e81f55b545b09b9954ab097248972ab3"
"ref": "673836afb0eac2b0ec36c44f2ff0379e5a4b2177"
}
},
"symfony/phpunit-bridge": {
Expand Down

0 comments on commit c8767b4

Please sign in to comment.