@@ -76,12 +76,27 @@ services:
7676 - OTEL_SERVICE_NAME=cart
7777 - ASPNETCORE_URLS=http://*:${CART_PORT}
7878 depends_on :
79- valkey-cart :
80- condition : service_started
79+
8180 otel-collector :
8281 condition : service_started
8382 logging : *logging
84-
83+ cart-dapr :
84+ image : " daprio/daprd:edge"
85+ container_name : cart-dapr
86+ command : [ "./daprd",
87+ " -app-id" , "cart",
88+ " -app-port" , "${CART_PORT}",
89+ " -placement-host-address" , "dapr-placement:50006",
90+ " -components-path" , "/components", "-components-path", "/components",
91+ " -config" , "/configuration/config.yaml" ]
92+ volumes :
93+ - " ./src/dapr/components/:/components"
94+ - " ./src/dapr/:/configuration"
95+ depends_on :
96+ - cart
97+ - valkey-cart
98+ - dapr-placement
99+ network_mode : " service:cart"
85100 # Checkout service
86101 checkout :
87102 image : ${IMAGE_NAME}:${DEMO_VERSION}-checkout
@@ -382,6 +397,17 @@ services:
382397 condition : service_started
383398 logging : *logging
384399
400+ product_db :
401+ image : postgres:15.3-alpine3.18
402+ restart : always
403+ environment :
404+ - POSTGRES_USER=postgres
405+ - POSTGRES_PASSWORD=postgres123
406+ volumes :
407+ - ./src/postgresql/product/init.sql:/docker-entrypoint-initdb.d/init.sql
408+ - ./src/postgresql/data:/var/lib/postgresql/data
409+ ports :
410+ - 5436:5432
385411 # Product Catalog service
386412 product-catalog :
387413 image : ${IMAGE_NAME}:${DEMO_VERSION}-product-catalog
@@ -414,6 +440,26 @@ services:
414440 condition : service_started
415441 logging : *logging
416442
443+ product-dapr :
444+ image : " daprio/daprd:edge"
445+ container_name : product-dapr
446+ command : [ "./daprd",
447+ " -app-id" , "product-catalog",
448+ " -app-port" , "${PRODUCT_CATALOG_PORT}",
449+ " -placement-host-address" , "dapr-placement:50006",
450+ " -resources-path" , "/configuration/config.yaml",
451+ " -config" , "/dapr/config.yaml" ]
452+ volumes :
453+ - " ./src/dapr/components/:/components"
454+ - " ./src/dapr/:/configuration"
455+ depends_on :
456+ product_db :
457+ condition : service_started
458+ dapr-placement :
459+ condition : service_started
460+ logging : *logging
461+ network_mode : " service:product-catalog"
462+
417463 # Quote service
418464 quote :
419465 image : ${IMAGE_NAME}:${DEMO_VERSION}-quote
@@ -546,7 +592,15 @@ services:
546592 - " ${VALKEY_PORT}"
547593 logging : *logging
548594
549-
595+ # ********************
596+ # Dapr Components
597+ # ********************
598+ dapr-placement :
599+ image : " daprio/dapr"
600+ container_name : dapr-placement
601+ command : [ "./placement", "-port", "50006" ]
602+ ports :
603+ - " 50006:50006"
550604 # ********************
551605 # Telemetry Components
552606 # ********************
0 commit comments