Create a Docker image and deploy it

This commit is contained in:
2024-06-05 10:17:54 +02:00
parent 999dbee2c6
commit ab95e3d286
13 changed files with 269 additions and 2 deletions

55
frankenphp/Caddyfile Normal file
View File

@@ -0,0 +1,55 @@
{
{$CADDY_GLOBAL_OPTIONS}
frankenphp {
#worker /path/to/your/worker.php
{$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
order php before file_server
}
{$CADDY_EXTRA_CONFIG}
{$SERVER_NAME:localhost} {
log {
# # Redact the authorization query parameter that can be set by Mercure
# format filter {
# wrap console
# fields {
# uri query {
# replace authorization REDACTED
# }
# }
# }
output stdout
}
root * public/
encode zstd br gzip
# Uncomment the following lines to enable Mercure and Vulcain modules
#mercure {
# # Transport to use (default to Bolt)
# transport_url {$MERCURE_TRANSPORT_URL:bolt:///data/mercure.db}
# # Publisher JWT key
# publisher_jwt {env.MERCURE_PUBLISHER_JWT_KEY} {env.MERCURE_PUBLISHER_JWT_ALG}
# # Subscriber JWT key
# subscriber_jwt {env.MERCURE_SUBSCRIBER_JWT_KEY} {env.MERCURE_SUBSCRIBER_JWT_ALG}
# # Allow anonymous subscribers (double-check that it's what you want)
# anonymous
# # Enable the subscription API (double-check that it's what you want)
# subscriptions
# # Extra directives
# {$MERCURE_EXTRA_DIRECTIVES}
#}
#vulcain
{$CADDY_SERVER_EXTRA_DIRECTIVES}
php_server
}

13
frankenphp/conf.d/app.ini Normal file
View File

@@ -0,0 +1,13 @@
expose_php = 0
date.timezone = UTC
apc.enable_cli = 1
session.use_strict_mode = 1
zend.detect_unicode = 0
; https://symfony.com/doc/current/performance.html
realpath_cache_size = 4096K
realpath_cache_ttl = 600
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 20000
opcache.memory_consumption = 256
opcache.enable_file_override = 1

View File

@@ -0,0 +1,2 @@
opcache.preload_user = root
opcache.preload = /app/config/preload.php

4
frankenphp/start.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
php bin/console doctrine:migrations:migrate --no-interaction
exec frankenphp run --config /etc/caddy/Caddyfile

View File

@@ -0,0 +1,4 @@
worker {
file ./public/index.php
env APP_RUNTIME Runtime\FrankenPhpSymfony\Runtime
}