Skip to content

Commit a14cce1

Browse files
committed
fixes
1 parent 9ea6e24 commit a14cce1

File tree

13 files changed

+137
-245
lines changed

13 files changed

+137
-245
lines changed

.editorconfig

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,18 @@
55
root = true
66

77
[*]
8-
# Change these settings to your own preference
9-
indent_style = space
10-
indent_size = 4
11-
12-
# We recommend you to keep these unchanged
13-
end_of_line = lf
148
charset = utf-8
15-
trim_trailing_whitespace = true
169
insert_final_newline = true
17-
18-
[*.{js,html,ts,tsx}]
19-
indent_size = 2
20-
21-
[*.json]
22-
indent_size = 2
23-
24-
[*.md]
25-
trim_trailing_whitespace = false
26-
27-
[*.sh]
28-
indent_style = tab
29-
30-
[*.xml.dist]
10+
end_of_line = lf
3111
indent_style = space
3212
indent_size = 4
3313

34-
[*.{yaml,yml}]
35-
trim_trailing_whitespace = false
36-
37-
[.github/workflows/*.yml]
38-
indent_size = 2
39-
40-
[.gitmodules]
14+
[**/{Dockerfile,Caddyfile,*.sh}]
4115
indent_style = tab
4216

43-
[.php_cs.dist]
44-
indent_style = space
45-
indent_size = 4
46-
47-
[composer.json]
48-
indent_size = 4
49-
50-
[{compose}.{*.yaml,*.yml,yaml,yml}]
17+
[{compose.*yaml,.github/**/*.yaml}]
5118
indent_size = 2
5219

53-
[Dockerfile,Caddyfile,Makefile]
54-
indent_style = tab
20+
[**.md]
21+
indent_size = unset
22+
indent_style = unset

.github/linters/zizmor.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
rules:
3-
unpinned-uses:
4-
config:
5-
policies:
6-
"*": ref-pin
3+
unpinned-uses:
4+
config:
5+
policies:
6+
"*": ref-pin

.github/workflows/ci.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ RUN \
5858
# Give write access to /config/caddy and /data/caddy
5959
chown -R ${USER}:${USER} /config/caddy /data/caddy
6060

61-
USER ${USER}
62-
6361
ENTRYPOINT ["docker-entrypoint"]
6462

6563
HEALTHCHECK --start-period=60s CMD curl -f http://localhost:2019/metrics || exit 1
@@ -81,6 +79,8 @@ RUN set -eux; \
8179

8280
COPY --link frankenphp/conf.d/20-app.dev.ini $PHP_INI_DIR/app.conf.d/
8381

82+
USER ${USER}
83+
8484
CMD [ "frankenphp", "run", "--config", "/etc/frankenphp/Caddyfile", "--watch" ]
8585

8686
# Prod FrankenPHP image
@@ -107,3 +107,5 @@ RUN set -eux; \
107107
composer dump-env prod; \
108108
composer run-script --no-dev post-install-cmd; \
109109
chmod +x bin/console; sync;
110+
111+
USER ${USER}

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ with [FrankenPHP](https://frankenphp.dev) and [Caddy](https://caddyserver.com/)
1515

1616
## Features
1717

18-
- Production, development and CI ready
19-
- Just 1 service by default
20-
- Blazing-fast performance thanks to [the worker mode of FrankenPHP](https://github.com/dunglas/frankenphp/blob/main/docs/worker.md) (automatically enabled in prod mode)
21-
- [Installation of extra Docker Compose services](docs/extra-services.md) with Symfony Flex
22-
- Automatic HTTPS (in dev and prod)
23-
- HTTP/3 and [Early Hints](https://symfony.com/blog/new-in-symfony-6-3-early-hints) support
24-
- Real-time messaging thanks to a built-in [Mercure hub](https://symfony.com/doc/current/mercure.html)
25-
- [Vulcain](https://vulcain.rocks) support
26-
- Native [XDebug](docs/xdebug.md) integration
27-
- Super-readable configuration
18+
- Production, development and CI ready
19+
- Just 1 service by default
20+
- Blazing-fast performance thanks to [the worker mode of FrankenPHP](https://github.com/dunglas/frankenphp/blob/main/docs/worker.md) (automatically enabled in prod mode)
21+
- [Installation of extra Docker Compose services](docs/extra-services.md) with Symfony Flex
22+
- Automatic HTTPS (in dev and prod)
23+
- HTTP/3 and [Early Hints](https://symfony.com/blog/new-in-symfony-6-3-early-hints) support
24+
- Real-time messaging thanks to a built-in [Mercure hub](https://symfony.com/doc/current/mercure.html)
25+
- [Vulcain](https://vulcain.rocks) support
26+
- Native [XDebug](docs/xdebug.md) integration
27+
- Super-readable configuration
2828

2929
**Enjoy!**
3030

compose.override.yaml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
---
22
# Development environment override
33
services:
4-
php:
5-
build:
6-
context: .
7-
target: frankenphp_dev
8-
volumes:
9-
- ./:/app
10-
- ./frankenphp/Caddyfile:/etc/frankenphp/Caddyfile:ro
11-
- ./frankenphp/conf.d/20-app.dev.ini:/usr/local/etc/php/app.conf.d/20-app.dev.ini:ro
12-
# If you develop on Mac or Windows you can remove the vendor/ directory
13-
# from the bind-mount for better performance by enabling the next line:
14-
#- /app/vendor
15-
environment:
16-
FRANKENPHP_WORKER_CONFIG: watch
17-
MERCURE_EXTRA_DIRECTIVES: demo
18-
# See https://xdebug.org/docs/all_settings#mode
19-
XDEBUG_MODE: "${XDEBUG_MODE:-off}"
20-
APP_ENV: "${APP_ENV:-dev}"
21-
extra_hosts:
22-
# Ensure that host.docker.internal is correctly defined on Linux
23-
- host.docker.internal:host-gateway
24-
tty: true
4+
php:
5+
build:
6+
context: .
7+
target: frankenphp_dev
8+
volumes:
9+
- ./:/app
10+
- ./frankenphp/Caddyfile:/etc/frankenphp/Caddyfile:ro
11+
- ./frankenphp/conf.d/20-app.dev.ini:/usr/local/etc/php/app.conf.d/20-app.dev.ini:ro
12+
# If you develop on Mac or Windows you can remove the vendor/ directory
13+
# from the bind-mount for better performance by enabling the next line:
14+
#- /app/vendor
15+
environment:
16+
FRANKENPHP_WORKER_CONFIG: watch
17+
MERCURE_EXTRA_DIRECTIVES: demo
18+
# See https://xdebug.org/docs/all_settings#mode
19+
XDEBUG_MODE: "${XDEBUG_MODE:-off}"
20+
APP_ENV: "${APP_ENV:-dev}"
21+
extra_hosts:
22+
# Ensure that host.docker.internal is correctly defined on Linux
23+
- host.docker.internal:host-gateway
24+
tty: true
2525
###> symfony/mercure-bundle ###
2626
###< symfony/mercure-bundle ###

compose.prod.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
# Production environment override
33
services:
4-
php:
5-
build:
6-
context: .
7-
target: frankenphp_prod
8-
environment:
9-
APP_SECRET: ${APP_SECRET}
10-
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET}
11-
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET}
4+
php:
5+
build:
6+
context: .
7+
target: frankenphp_prod
8+
environment:
9+
APP_SECRET: ${APP_SECRET}
10+
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET}
11+
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET}

compose.yaml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
---
22
services:
3-
php:
4-
image: ${IMAGES_PREFIX:-}app-php
5-
restart: unless-stopped
6-
environment:
7-
SERVER_NAME: ${SERVER_NAME:-localhost}, php:80
8-
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
9-
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
10-
# Run "composer require symfony/orm-pack" to install and configure Doctrine ORM
11-
DATABASE_URL: postgresql://${POSTGRES_USER:-app}:${POSTGRES_PASSWORD:-!ChangeMe!}@database:5432/${POSTGRES_DB:-app}?serverVersion=${POSTGRES_VERSION:-15}&charset=${POSTGRES_CHARSET:-utf8}
12-
# Run "composer require symfony/mercure-bundle" to install and configure the Mercure integration
13-
MERCURE_URL: ${CADDY_MERCURE_URL:-http://php/.well-known/mercure}
14-
MERCURE_PUBLIC_URL: ${CADDY_MERCURE_PUBLIC_URL:-https://${SERVER_NAME:-localhost}:${HTTPS_PORT:-443}/.well-known/mercure}
15-
MERCURE_JWT_SECRET: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
16-
# The two next lines can be removed after initial installation
17-
SYMFONY_VERSION: ${SYMFONY_VERSION:-}
18-
STABILITY: ${STABILITY:-stable}
19-
volumes:
20-
- caddy_data:/data
21-
- caddy_config:/config
22-
ports:
23-
# HTTP
24-
- target: 80
25-
published: ${HTTP_PORT:-80}
26-
protocol: tcp
27-
# HTTPS
28-
- target: 443
29-
published: ${HTTPS_PORT:-443}
30-
protocol: tcp
31-
# HTTP/3
32-
- target: 443
33-
published: ${HTTP3_PORT:-443}
34-
protocol: udp
3+
php:
4+
image: ${IMAGES_PREFIX:-}app-php
5+
restart: unless-stopped
6+
environment:
7+
SERVER_NAME: ${SERVER_NAME:-localhost}, php:80
8+
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
9+
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
10+
# Run "composer require symfony/orm-pack" to install and configure Doctrine ORM
11+
DATABASE_URL: postgresql://${POSTGRES_USER:-app}:${POSTGRES_PASSWORD:-!ChangeMe!}@database:5432/${POSTGRES_DB:-app}?serverVersion=${POSTGRES_VERSION:-15}&charset=${POSTGRES_CHARSET:-utf8}
12+
# Run "composer require symfony/mercure-bundle" to install and configure the Mercure integration
13+
MERCURE_URL: ${CADDY_MERCURE_URL:-http://php/.well-known/mercure}
14+
MERCURE_PUBLIC_URL: ${CADDY_MERCURE_PUBLIC_URL:-https://${SERVER_NAME:-localhost}:${HTTPS_PORT:-443}/.well-known/mercure}
15+
MERCURE_JWT_SECRET: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
16+
# The two next lines can be removed after initial installation
17+
SYMFONY_VERSION: ${SYMFONY_VERSION:-}
18+
STABILITY: ${STABILITY:-stable}
19+
volumes:
20+
- caddy_data:/data
21+
- caddy_config:/config
22+
ports:
23+
# HTTP
24+
- target: 80
25+
published: ${HTTP_PORT:-80}
26+
protocol: tcp
27+
# HTTPS
28+
- target: 443
29+
published: ${HTTPS_PORT:-443}
30+
protocol: tcp
31+
# HTTP/3
32+
- target: 443
33+
published: ${HTTP3_PORT:-443}
34+
protocol: udp
3535

3636
# Mercure is installed as a Caddy module, prevent the Flex recipe from installing another service
3737
###> symfony/mercure-bundle ###
3838
###< symfony/mercure-bundle ###
3939

4040
volumes:
41-
caddy_data:
42-
caddy_config:
41+
caddy_data:
42+
caddy_config:
4343
###> symfony/mercure-bundle ###
4444
###< symfony/mercure-bundle ###

docs/extra-services.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ the recipe will automatically modify the `Dockerfile` and `compose.yaml` to fulf
55

66
The currently supported packages are:
77

8-
- `symfony/orm-pack`: install a PostgreSQL service
9-
- `symfony/mercure-bundle`: use the Mercure.rocks module shipped with Caddy
10-
- `symfony/panther`: install chromium and these drivers
11-
- `symfony/mailer`: install a Mailpit service
12-
- `blackfireio/blackfire-symfony-meta`: install a Blackfire service
8+
- `symfony/orm-pack`: install a PostgreSQL service
9+
- `symfony/mercure-bundle`: use the Mercure.rocks module shipped with Caddy
10+
- `symfony/panther`: install chromium and these drivers
11+
- `symfony/mailer`: install a Mailpit service
12+
- `blackfireio/blackfire-symfony-meta`: install a Blackfire service
1313

1414
> [!NOTE]
1515
> If a recipe modifies the Dockerfile, the container needs to be rebuilt.

docs/production.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ If you want to pass them to your containers, you can use the [`env_file` attribu
107107
# compose.prod.yml
108108

109109
services:
110-
php:
111-
env_file:
112-
- .env.prod.local
113-
# ...
110+
php:
111+
env_file:
112+
- .env.prod.local
113+
# ...
114114
```

0 commit comments

Comments
 (0)