forum/docs/existing-project.md

45 lines
1.4 KiB
Markdown
Raw Normal View History

# Installing on an Existing Project
2021-06-18 16:17:56 +02:00
It's also possible to use Symfony Docker with existing projects!
First, [download this skeleton](https://github.com/dunglas/symfony-docker).
If you cloned the Git repository, be sure to not copy the `.git` directory to prevent conflicts with the `.git` directory already in your existing project.
You can copy the contents of the repository using git and tar. This will not contain `.git` or any uncommited changes.
git archive --format=tar HEAD | tar -xC my-existing-project/
2024-03-27 16:27:32 +01:00
If you downloaded the skeleton as a zip you can just copy the extracted files:
cp -Rp symfony-docker/. my-existing-project/
Enable the Docker support of Symfony Flex:
composer config --json extra.symfony.docker 'true'
2021-06-18 16:17:56 +02:00
Re-execute the recipes to update the Docker-related files according to the packages you use
rm symfony.lock
composer recipes:install --force --verbose
Double-check the changes, revert the changes that you don't want to keep:
git diff
...
Build the Docker images:
2022-07-28 19:01:17 +02:00
docker compose build --no-cache --pull
2021-06-18 16:17:56 +02:00
Start the project!
2022-07-28 19:01:17 +02:00
docker compose up -d
Browse `https://localhost`, your Docker configuration is ready!
2023-12-03 21:51:35 +01:00
> [!NOTE]
> If you want to use the worker mode of FrankenPHP, make sure you required the `runtime/frankenphp-symfony` package.
> [!NOTE]
> The worker mode of FrankenPHP is enabled by default in prod. To disabled it, add the env var FRANKENPHP_CONFIG as empty to the compose.prod.yaml file.