Visual Studio makes it really easy to create a Docker compose file for an existing solution.
Here are the steps to get there:
- Open your solution in Visual Studio
- Right click on one of your projects and choose Add –> Container Orchestrator Support
- Choose Docker compose in the Add Container Orchestrator dialog and click OK
- Choose Linux as the Target OS and click OK
- A new Docker Compose project is generated
- Inside this project you find a docker-compose.yml file with a reference to the project you’ve selected
- To add the other projects, follow the same procedure; right click on another project and choose Add –> Container Orchestrator Support again
- The docker-compose.yml file will be updated with the new project information