Skip to content

Commit 75f0779

Browse files
committed
Init
1 parent cc06305 commit 75f0779

23 files changed

+2980
-0
lines changed

.docker/Caddyfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
{$CADDY_GLOBAL_OPTIONS}
3+
4+
frankenphp {
5+
# worker /srv/www/worker.php
6+
{$FRANKENPHP_CONFIG}
7+
}
8+
order php_server before file_server
9+
}
10+
11+
{$CADDY_EXTRA_CONFIG}
12+
13+
{$SERVER_NAME:localhost} {
14+
root * /srv/www/
15+
16+
{$CADDY_SERVER_EXTRA_DIRECTIVES}
17+
18+
@indexFiles file {
19+
try_files {path} worker.php
20+
split_path .php
21+
}
22+
rewrite @indexFiles {http.matchers.file.relative}
23+
24+
encode zstd gzip
25+
php_server
26+
}

.docker/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM dunglas/frankenphp:1.2.5-php8.3-bookworm
2+
3+
RUN echo "variables_order = \"EGPCS\"" >> $PHP_INI_DIR/conf.d/990-php.ini
4+
5+
RUN install-php-extensions xdebug
6+
7+
RUN echo "[xdebug]" >> $PHP_INI_DIR/conf.d/991-xdebug.ini && \
8+
echo "xdebug.mode=debug" >> $PHP_INI_DIR/conf.d/991-xdebug.ini && \
9+
echo "xdebug.client_host=host.docker.internal" >> $PHP_INI_DIR/conf.d/991-xdebug.ini && \
10+
echo "xdebug.start_with_request=yes" >> $PHP_INI_DIR/conf.d/991-xdebug.ini
11+
12+
WORKDIR /srv
13+
14+
COPY . /srv
15+
COPY .docker/Caddyfile /etc/caddy/Caddyfile

.docs/phpinfo.png

3.65 MB
Loading

.docs/terminal.png

2.28 MB
Loading

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
indent_style = tab
11+
indent_size = tab
12+
tab_width = 4
13+
14+
[{*.json, *.yaml, *.yml, *.md}]
15+
indent_style = space
16+
indent_size = 2

.github/.kodiak.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version = 1
2+
3+
[merge]
4+
automerge_label = "automerge"
5+
blacklist_title_regex = "^WIP.*"
6+
blacklist_labels = ["WIP"]
7+
method = "rebase"
8+
delete_branch_on_merge = true
9+
notify_on_conflict = true
10+
optimistic_updates = false

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: composer
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
labels:
8+
- "dependencies"
9+
- "automerge"

.github/workflows/php.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: "PHP"
2+
3+
on:
4+
pull_request:
5+
6+
push:
7+
branches: [ "*" ]
8+
9+
schedule:
10+
- cron: "0 8 * * 1"
11+
12+
jobs:
13+
php:
14+
name: "PHP check"
15+
uses: contributte/.github/.github/workflows/php.yml@v1
16+
with:
17+
name: "PHP check"
18+
php: "8.2"
19+
run: "composer validate"

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# IDE
2+
/.idea
3+
4+
# Composer
5+
/vendor
6+
7+
# Apache
8+
!.htaccess
9+
10+
# Nette
11+
/config/local.neon
12+
/var

README.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
![](https://heatbadger.now.sh/github/readme/contributte/demo-frankenphp/)
2+
3+
<p align=center>
4+
<a href="https://github.com/contributte/demo-frankenphp/actions"><img src="https://badgen.net/github/checks/contributte/demo-frankenphp/master"></a>
5+
<a href="https://coveralls.io/r/contributte/demo-frankenphp"><img src="https://badgen.net/coveralls/c/github/contributte/demo-frankenphp"></a>
6+
<a href="https://packagist.org/packages/contributte/demo-frankenphp"><img src="https://badgen.net/packagist/dm/contributte/demo-frankenphp"></a>
7+
<a href="https://packagist.org/packages/contributte/demo-frankenphp"><img src="https://badgen.net/packagist/v/contributte/demo-frankenphp"></a>
8+
</p>
9+
<p align=center>
10+
<a href="https://packagist.org/packages/contributte/demo-frankenphp"><img src="https://badgen.net/packagist/php/contributte/demo-frankenphp"></a>
11+
<a href="https://github.com/contributte/demo-frankenphp"><img src="https://badgen.net/github/license/contributte/demo-frankenphp"></a>
12+
<a href="https://bit.ly/ctteg"><img src="https://badgen.net/badge/support/gitter/cyan"></a>
13+
<a href="https://bit.ly/cttfo"><img src="https://badgen.net/badge/support/forum/yellow"></a>
14+
<a href="https://contributte.org/partners.html"><img src="https://badgen.net/badge/sponsor/donations/F96854"></a>
15+
</p>
16+
17+
<p align=center>
18+
Website 🚀 <a href="https://contributte.org">contributte.org</a> | Contact 👨🏻‍💻 <a href="https://f3l1x.io">f3l1x.io</a> | Twitter 🐦 <a href="https://twitter.com/contributte">@contributte</a>
19+
</p>
20+
21+
-----
22+
23+
## Goal
24+
25+
Demo of [FrankenPHP](https://github.com/dunglas/frankenphp) with [Nette Framework](https://nette.org).
26+
27+
## Installation
28+
29+
You will need `PHP 8.2+` and [Composer](https://getcomposer.org/).
30+
31+
Create project using composer.
32+
33+
```bash
34+
composer create-project -s dev contributte/demo-frankenphp acme
35+
```
36+
37+
Now you have application installed. It's time to run it.
38+
39+
## Startup
40+
41+
Spin up Docker stack. FrankenPHP with Caddyserver.
42+
43+
```bash
44+
docker compose up
45+
```
46+
47+
Then visit [http://localhost:8080](http://localhost:8000) in your browser.
48+
49+
List of URL's:
50+
51+
- [http://localhost:8080/](http://localhost:8000)
52+
- [http://localhost:8080/api](http://localhost:8000/api)
53+
- [http://localhost:8080/api/phpinfo](http://localhost:8000/api/phpinfo)
54+
55+
## Benchmark
56+
57+
```
58+
➜ hey -n 200 -c 100 http://localhost:8080/
59+
60+
Summary:
61+
Total: 0.0526 secs
62+
Slowest: 0.0512 secs
63+
Fastest: 0.0010 secs
64+
Average: 0.0228 secs
65+
Requests/sec: 3804.3427
66+
67+
68+
Response time histogram:
69+
0.001 [1] |■
70+
0.006 [69] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
71+
0.011 [26] |■■■■■■■■■■■■■■■
72+
0.016 [4] |■■
73+
0.021 [0] |
74+
0.026 [0] |
75+
0.031 [0] |
76+
0.036 [16] |■■■■■■■■■
77+
0.041 [43] |■■■■■■■■■■■■■■■■■■■■■■■■■
78+
0.046 [14] |■■■■■■■■
79+
0.051 [27] |■■■■■■■■■■■■■■■■
80+
81+
82+
Latency distribution:
83+
10% in 0.0016 secs
84+
25% in 0.0030 secs
85+
50% in 0.0346 secs
86+
75% in 0.0386 secs
87+
90% in 0.0485 secs
88+
95% in 0.0493 secs
89+
99% in 0.0509 secs
90+
91+
Details (average, fastest, slowest):
92+
DNS+dialup: 0.0069 secs, 0.0010 secs, 0.0512 secs
93+
DNS-lookup: 0.0020 secs, 0.0000 secs, 0.0054 secs
94+
req write: 0.0001 secs, 0.0000 secs, 0.0033 secs
95+
resp wait: 0.0157 secs, 0.0009 secs, 0.0365 secs
96+
resp read: 0.0001 secs, 0.0000 secs, 0.0013 secs
97+
98+
Status code distribution:
99+
[500] 200 responses
100+
```
101+
102+
## Development
103+
104+
See [how to contribute](https://contributte.org/contributing.html) to this package.
105+
106+
This package is currently maintaining by these authors.
107+
108+
<a href="https://github.com/f3l1x">
109+
<img width="80" height="80" src="https://avatars2.githubusercontent.com/u/538058?v=3&s=80">
110+
</a>
111+
112+
-----
113+
114+
Consider to [support](https://contributte.org/partners.html) **contributte** development team. Also thank you for using this project.

0 commit comments

Comments
 (0)