Skip to content

Commit 2cca5de

Browse files
committed
feat(franken): add config and dashboard
1 parent 38071b7 commit 2cca5de

File tree

14 files changed

+1126
-1830
lines changed

14 files changed

+1126
-1830
lines changed

.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,7 @@ DATABASE_URL=sqlite:///%kernel.project_dir%/data/database.sqlite
4040
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
4141
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
4242
###< symfony/messenger ###
43+
44+
###> FPM Status Configuration ###
45+
FPM_STATUS_URL=http://localhost/fpm-status?full&json
46+
###< FPM Status Configuration ###

Dockerfile

Whitespace-only changes.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ up:
6464
docker-compose up -d redis
6565

6666
down:
67-
docker-compose up -d down
67+
docker-compose down
6868

6969

7070
ps:

data/database.sqlite

0 Bytes
Binary file not shown.

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ services:
2626
tty: true
2727
environment:
2828
SERVER_NAME: ":8080 https://localhost:443"
29+
CADDY_GLOBAL_OPTIONS: "admin 0.0.0.0:2019\n"
2930
networks:
3031
- app-net
3132

docker/Caddyfile

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,12 @@
33
metrics
44

55
frankenphp {
6+
num_threads 16 # 4 × CPU cores
7+
max_threads auto # let FrankenPHP scale
8+
69
worker {
710
file ./public/index.php
8-
watch
9-
10-
num 1 # change number of worker
11-
12-
## Uncomment for incorrect config
13-
# num_threads 16
14-
# max_threads 8
15-
16-
## Uncomment for correct config
17-
# num_threads 16
18-
# max_threads 32
11+
num 8 # 1 worker per CPU core
1912
}
2013

2114
php_ini memory_limit 512M

docker/Caddyfile.regular

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,60 @@
1+
# The Caddyfile is an easy way to configure FrankenPHP and the Caddy web server.
2+
#
3+
# https://frankenphp.dev/docs/config
4+
# https://caddyserver.com/docs/caddyfile
5+
16
{
7+
skip_install_trust
8+
29
admin 0.0.0.0:2019
310
metrics
411

512
frankenphp {
6-
php_ini memory_limit 512M
13+
{$FRANKENPHP_CONFIG}
714
}
815
}
916

17+
{$CADDY_EXTRA_CONFIG}
18+
1019
{$SERVER_NAME:localhost} {
20+
#log {
21+
# # Redact the authorization query parameter that can be set by Mercure
22+
# format filter {
23+
# request>uri query {
24+
# replace authorization REDACTED
25+
# }
26+
# }
27+
#}
28+
1129
root {$SERVER_ROOT:public/}
12-
encode zstd br gzip
30+
encode zstd br gzip
31+
32+
# Uncomment the following lines to enable Mercure and Vulcain modules
33+
#mercure {
34+
# # Transport to use (default to Bolt)
35+
# transport_url {$MERCURE_TRANSPORT_URL:bolt:///data/mercure.db}
36+
# # Publisher JWT key
37+
# publisher_jwt {env.MERCURE_PUBLISHER_JWT_KEY} {env.MERCURE_PUBLISHER_JWT_ALG}
38+
# # Subscriber JWT key
39+
# subscriber_jwt {env.MERCURE_SUBSCRIBER_JWT_KEY} {env.MERCURE_SUBSCRIBER_JWT_ALG}
40+
# # Allow anonymous subscribers (double-check that it's what you want)
41+
# anonymous
42+
# # Enable the subscription API (double-check that it's what you want)
43+
# subscriptions
44+
# # Extra directives
45+
# {$MERCURE_EXTRA_DIRECTIVES}
46+
#}
47+
#vulcain
1348

1449
{$CADDY_SERVER_EXTRA_DIRECTIVES}
1550

16-
php_server
51+
php_server {
52+
#worker /path/to/your/worker.php
53+
}
1754
}
55+
56+
# As an alternative to editing the above site block, you can add your own site
57+
# block files in the Caddyfile.d directory, and they will be included as long
58+
# as they use the .caddyfile extension.
59+
60+
import Caddyfile.d/*.caddyfile

0 commit comments

Comments
 (0)