-
Notifications
You must be signed in to change notification settings - Fork 44
[Example] [WIP] Add Symfony Docker with FrankenPHP #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
e7b91df to
6f7677f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking the lines which are different to dunglas/symfony-docker:
| # additional sulu extensions | ||
| RUN set -eux; \ | ||
| install-php-extensions \ | ||
| gd \ | ||
| curl \ | ||
| dom \ | ||
| bz2 \ | ||
| ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This we added additional atleast gd is required to run Sulu. Alternative is imagick or ffi (when using vips adapter)
|
|
||
| ###> recipes ### | ||
| ###> doctrine/doctrine-bundle ### | ||
| RUN install-php-extensions pdo_mysql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is required by default postgres is here but demo comes with MySQL
| MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!} | ||
| MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!} | ||
| # Run "composer require symfony/orm-pack" to install and configure Doctrine ORM | ||
| DATABASE_URL: mysql://${MYSQL_USER:-root}:${MYSQL_PASSWORD:-ChangeMe}@database:3306/${MYSQL_DATABASE:-su_demo}?serverVersion=${MYSQL_VERSION:-8}&charset=${MYSQL_CHARSET:-utf8mb4} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is hardcoded to postgres in symfony docker we changed this to mysql
| @@ -0,0 +1,4 @@ | |||
| worker { | |||
| file ./public/index.php | |||
| # env APP_RUNTIME Runtime\FrankenPhpSymfony\Runtime | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a quick start without worker mode
cef7ed1 to
728dcfc
Compare
728dcfc to
59363ee
Compare
| MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!} | ||
| # Run "composer require symfony/orm-pack" to install and configure Doctrine ORM | ||
| DATABASE_URL: mysql://${MYSQL_USER:-root}:${MYSQL_PASSWORD:-ChangeMe}@database:3306/${MYSQL_DATABASE:-su_demo}?serverVersion=${MYSQL_VERSION:-8}&charset=${MYSQL_CHARSET:-utf8mb4} | ||
| ELASTICSEARCH_HOST: elasticsearch:9200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the demo uses elasticsearch so we need point to elasticsearch container instead go over the IP
Warning
This is WIP we will remove this warning when the example works as expected.
What's in this PR?
Example for Using Dunglas Symfony Docker: https://github.com/dunglas/symfony-docker, see also Sulu Docs PR: sulu/sulu-docs#829
Steps
Install https://github.com/dunglas/symfony-docker
Add additional PHP Extensions:
gd,pdo_mysqlUpdate in
compose.yamltheDATABASE_URL:DATABASE_URL: mysql://${MYSQL_USER:-root}:${MYSQL_PASSWORD:-ChangeMe}@database:3306/${MYSQL_DATABASE:-su_demo}?serverVersion=${MYSQL_VERSION:-8}&charset=${MYSQL_CHARSET:-utf8mb4}ELASTICSEARCH_HOSH: elasticsearch:9200Disable workermode in
worker.Caddyfilecomment APP_RUNTIME out:# env APP_RUNTIME Runtime\FrankenPhpSymfony\RuntimeIncrease
memory_limitif requiredfrankenphp/conf.d:10-app.ini,20-app.dev.ini,20-app.prod.ini:memory_limit=512MConfigure Volumes for
var/uploadsandpublic/uploads:Build the docker:
Start without TLS and other Ports (Mac don't allow bind :80 or :443):
Visit Server:
Go into the php container:
docker compose exec -ti php /bin/bash bin/console sulu:build dev