2021-06-18 14:39:55 +02:00
# Installing on an Existing Project
2021-06-18 16:17:56 +02:00
It's also possible to use Symfony Docker with existing projects!
2021-06-18 14:39:55 +02:00
2021-06-18 16:17:56 +02:00
First, [download this skeleton ](https://github.com/dunglas/symfony-docker ). If you clone the Git repository, be sure to remove the `.git` directory to prevent conflicts with the `.git` directory already in your existing project.
2021-06-18 14:39:55 +02:00
Then, copy the Docker-related files from the skeleton to your existing project:
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
2021-06-18 14:39:55 +02:00
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:
2022-07-28 19:01:17 +02:00
docker compose build --no-cache --pull
2021-06-18 14:39:55 +02:00
2021-06-18 16:17:56 +02:00
Start the project!
2021-06-18 14:39:55 +02:00
2022-07-28 19:01:17 +02:00
docker compose up -d
2021-06-18 14:39:55 +02:00
Browse `https://localhost` , your Docker configuration is ready!