86
CHAPTER 4 | Development process for Docker-based applications
Figure 5-7. Adding Docker support in Visual Studio 2022 by right-clicking an ASP.NET Core project
After you add orchestrator support to your solution in Visual Studio, you will also see a new node (in
the
docker-compose.dcproj
project file) in Solution Explorer that contains the added docker-
compose.yml files, as shown in Figure 5-8.
Figure 5-8. The docker-compose tree node added in Visual Studio 2022 Solution Explorer
You could deploy a multi-container application with a single docker-compose.yml file by using the
docker-compose up
command. However, Visual Studio adds a group of them so you can
override
values depending on the environment (development or production) and execution type (release or
debug). This capability will be explained in later sections.
Step 5. Build and run your Docker application
If your application only has a single container, you can run it by deploying it to your Docker host (VM
or physical server). However, if your application contains
multiple services, you can deploy it as a
composed application, either using a single CLI command (
docker-compose up)
, or with
Visual
Studio, which will us
e that command under the covers. Let’s look at the different options.
87
CHAPTER 4 | Development process for Docker-based applications
Dostları ilə paylaş: