From 74d44b8cc01a24e22649ecc2d742e3c18dd99b1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 18 Jun 2021 14:39:55 +0200 Subject: [PATCH] docs: explain how to use SF Docker with an existing project (#156) --- README.md | 9 +++++---- docs/existing-project.md | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 docs/existing-project.md diff --git a/README.md b/README.md index c48d4a6..4657f21 100644 --- a/README.md +++ b/README.md @@ -26,10 +26,11 @@ A [Docker](https://www.docker.com/)-based installer and runtime for the [Symfony ## Docs 1. [Build options](docs/build.md) -2. [Support for extra services](docs/extra-services.md) -3. [Deploying in production](docs/production.md) -4. [Installing Xdebug](docs/xdebug.md) -5. [Troubleshooting](docs/troubleshooting.md) +2. [Using Symfony Docker with an existing project](docs/existing-project.md) +3. [Support for extra services](docs/extra-services.md) +4. [Deploying in production](docs/production.md) +5. [Installing Xdebug](docs/xdebug.md) +6. [Troubleshooting](docs/troubleshooting.md) ## Credits diff --git a/docs/existing-project.md b/docs/existing-project.md new file mode 100644 index 0000000..9be0d0e --- /dev/null +++ b/docs/existing-project.md @@ -0,0 +1,33 @@ +# Installing on an Existing Project + +It's also to use Symfony Docker with existing projects! + +First, [download this skeleton](https://github.com/dunglas/symfony-docker). If you clone the Git repository, be sure to remove the `.git` repository to prevent conflicts with the `.git` directory already in your existing project. + +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' + +Re-execute the recipes to update the Docker-relatd files according to the packags 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 projects! + + docker-compose up -d + +Browse `https://localhost`, your Docker configuration is ready!