Skip to content

Automatically create Docker Compose files when needed #788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2021

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Aug 28, 2021

If you want to use Docker support in Flex, you must configure it explicitly in a project (via symfony composer config extra.symfony.docker true for instance). But that's not enough. You must also create the docker-compose.yaml file. And if you do not also create the docker-compose.override.yaml file, you will end up with half of the configuration.

In this PR, I propose to create those 2 files automatically if they don't exist when a service should be added by a recipe.

That way, using Docker support is "only" a matter of opting-in via composer.json.

/cc @dunglas

continue;
}

$this->write(sprintf('Adding Docker Compose definitions to "%s"', $dockerComposeFile));

$offset = 8;
$offset = 2;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default indentation for Docker Compose file is 2 spaces. This was not caught before as tests always used an existing file.

@fabpot fabpot merged commit 7572da3 into main Aug 28, 2021
@fabpot fabpot deleted the docker-support-simplification branch August 28, 2021 10:37
nicolas-grekas added a commit that referenced this pull request Nov 22, 2021
…lex (weaverryan)

This PR was merged into the 1.x branch.

Discussion
----------

Interactively asking if the user wants Docker support from Flex

Hi!

After #821 and #788, Docker support is enabled by default. This PR changes that behavior to interactively ask the user want they want:

<img width="1134" alt="Screen Shot 2021-11-18 at 11 36 55 AM" src="https://user-images.githubusercontent.com/121003/142457428-a23ea361-6359-481f-9941-5083146e9b3a.png">

This allows users to easily opt out. But it also allows users to immediately opt IN and get the Docker config.

I've tested this locally with every combination I could think of :)

Cheers!

Commits
-------

59c89c1 Interactively asking if the user wants Docker support from Flex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants