-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
Running Franken PHP | ||
=================== | ||
|
||
To add FrankenPHP to an existing project you can follow these steps: `FrankenPHP Documentation`_. | ||
|
||
However after running through those steps you need to modify the setup a slight bit: | ||
1. Installing the correct php extensions | ||
2. Adding a database to the project | ||
3. Removing Sulu's default configuration | ||
|
||
The modifications | ||
----------------- | ||
.. note:: | ||
Beware these instructions might get out of date if FrankenPHP Documentation changes. | ||
|
||
After installing you should have a `Dockerfile` which is the base for all containers. | ||
|
||
There should be a section under like this: | ||
.. code-block:: dockerfile | ||
# Base FrankenPHP image | ||
... | ||
RUN set -eux; \ | ||
install-php-extensions \ | ||
@composer \ | ||
apcu \ | ||
intl \ | ||
opcache \ | ||
zip \ | ||
; | ||
This is the list of installed extensions. For Sulu you also need: `gd` and `pdo_mysql` or `pdo_postgres`. | ||
|
||
Secondly we also need to add a database. We can just do that by adding it to the yaml configuration file `compose.yaml`. | ||
|
||
Here is an example configuration for mysql: | ||
|
||
.. code-block:: yaml | ||
services: | ||
# .... | ||
database: | ||
# arm compatible mysql docker image | ||
image: mysql/mysql-server:${MYSQL_VERSION:-8.0} # arm and x86/x64 compatible mysql image | ||
command: [ "--max_connections=1000", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_general_ci" ] | ||
environment: | ||
MYSQL_DATABASE: ${MYSQL_DATABASE:-sulu} | ||
# You should definitely change the password in production | ||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-ChangeMe} | ||
MYSQL_ROOT_HOST: '%' | ||
volumes: | ||
- db-data:/var/lib/mysql | ||
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data! | ||
# - ./docker/db/data:/var/lib/mysql:rw | ||
After setting up the container you might also want to update the `DATABASE_URL` variable in the php service (by default it assumes postgres). At least note that FrankenPHP and the default Sulu mysql container have different default credentials. | ||
|
||
If you have some other modifications in your set up be sure to copy all changes of the `docker-compose*` files to the `compose.yaml` and `compose.override.yaml`. | ||
|
||
After all this, the Sulu default configuration is not used anymore and can be removed: | ||
.. code-block:: bash | ||
rm docker-compose.yaml | ||
rm docker-compose.override.yaml | ||
.. _FrankenPHP Documentation: https://github.com/dunglas/symfony-docker/blob/main/docs/existing-project.md#installing-on-an-existing-project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ these tools. | |
apache | ||
nginx | ||
built-in | ||
franken-php |