【发布时间】:2019-08-29 15:13:49
【问题描述】:
我在 Visual Studio 中有一个 docker-compose 项目,它启动了 3 个服务。其中之一使用 cosmosdb。
我已按照https://hub.docker.com/r/microsoft/azure-cosmosdb-emulator/ 上的说明在 docker 容器中启动模拟器,它可以正常工作。
但现在我想通过 docker-compose 文件启动并运行它。以下是我目前的配置。
version: '3.4'
services:
gateway:
environment:
- ASPNETCORE_ENVIRONMENT=Development
image: ${DOCKER_REGISTRY-}gateway
ports:
- "7000:80"
depends_on:
- servicea
- serviceb
build:
context: .\ApiGateways\IAGTO.Fenix.ApiGateway
dockerfile: Dockerfile
servicea:
environment:
- ASPNETCORE_ENVIRONMENT=Development
image: ${DOCKER_REGISTRY-}servicea
depends_on:
- email.db
build:
context: .\Services\ServiceA
dockerfile: Dockerfile
serviceb:
environment:
- ASPNETCORE_ENVIRONMENT=Development
image: ${DOCKER_REGISTRY-}serviceb
build:
context: .\Services\ServiceB
dockerfile: Dockerfile
email.db:
image: microsoft/azure-cosmosdb-emulator
container_name: cosmosdb-emulator
ports:
- "8081:8081"
当我运行docker container list 时,我可以看到容器正在运行
但对https://localhost:8081/_explorer/index.html 的请求失败。
对此非常感谢的任何帮助
【问题讨论】:
标签: visual-studio docker .net-core docker-compose azure-cosmosdb-sqlapi