docs: explain how to use SF Docker with an existing project (#156)

This commit is contained in:
Kévin Dunglas 2021-06-18 14:39:55 +02:00 committed by GitHub
parent cd0c784387
commit 74d44b8cc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 4 deletions

View File

@ -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

33
docs/existing-project.md Normal file
View File

@ -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!