Edition 0 Updated to asp. Net core 0


Creating Docker images with Visual Studio



Yüklə 11,82 Mb.
Pdf görüntüsü
səhifə80/288
tarix12.07.2023
ölçüsü11,82 Mb.
#136458
1   ...   76   77   78   79   80   81   82   83   ...   288
NET-Microservices-Architecture-for-Containerized-NET-Applications

Creating Docker images with Visual Studio 
When you use Visual Studio to create a project with Docker support, you don’t explicitly create an 
image. Instead, the image is created for you when you press F5 (or Ctrl+F5) to run the dockerized 
application or service. This step is automatic in Visual Studio and you won’t see it happen, but it’s 
important that you know what’s going on underneath.
Step 4. Define your services in docker-compose.yml when building a 
multi-container Docker application 
The 
docker-compose.yml
 file lets you define a set of related services to be deployed as a composed 
application with deployment commands. It also configures its dependency relations and runtime 
configuration. 
To use a docker-compose.yml file, you need to create the file in your main or root solution folder, with 
content similar to that in the following example: 
version:
'3.4'
services:
webmvc:
image:
eshop/web
environment:
-
CatalogUrl=http:
//catalog-api
-
OrderingUrl=http:
//ordering-api
ports:
-
"80:80"
depends_on:
-
catalog-api 
-
ordering-api 
catalog-api:
image:
eshop/catalog-api
environment:
-
ConnectionString=Server=sqldata;Port=1433;Database=CatalogDB;…
ports:
-
"81:80"
depends_on:
-
sqldata 
ordering-api:
image:
eshop/ordering-api
environment:
-
ConnectionString=Server=sqldata;Database=OrderingDb;…
ports:
-
"82:80"
extra_hosts:
-
"CESARDLBOOKVHD:10.0.75.1"
depends_on:


85 
CHAPTER 4 | Development process for Docker-based applications 

Yüklə 11,82 Mb.

Dostları ilə paylaş:
1   ...   76   77   78   79   80   81   82   83   ...   288




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin