Files
forum/docs/existing-project.md
m1mir 645c384e16 Added git specific file copy command to docs.
With the new instructions the copying to an existing project doesn't
destoy the cloned symfony-docker repository.
2024-03-28 12:43:05 +01:00

1.3 KiB

Installing on an Existing Project

It's also possible to use Symfony Docker with existing projects!

First, download this skeleton.

If you cloned the Git repository you can copy the files from the repository using git and tar:

git archive --format=tar HEAD | tar -xC my-existing-project/

If you downloaded the skeleton with 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'

Re-execute the recipes to update the Docker-related files according to the packages you use

rm symfony.lock
composer symfony:sync-recipes --force --verbose

Double-check the changes, revert the changes that you don't want to keep:

git diff
...

Build the Docker images:

docker compose build --no-cache --pull

Start the project!

docker compose up -d

Browse https://localhost, your Docker configuration is ready!

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.