我在docker-compose脚本下面
version: '3.1'
services:
generator:
image: my-registry:55000/gen:ci-8
ports:
- "8080:80"
mail:
image: mailhog/mailhog
ports:
- "8025:8025"
integration:
image: my-registry:55000/gen:integration-9
build: .
从集成服务中,我正在按以下方式调用生成器服务
public const string GeneratorApiRoot = "http://generator:80";
var client = new HttpClient();
var sendEmail = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri($"{GeneratorApiRoot}/EmailRandomNames")
};
using (var response = await client.SendAsync(sendEmail))
{
response.EnsureSuccessStatusCode();
}
我正在获取状态代码404找不到错误味精。但是,当我使用http://localhost:8080/EmailRandomNames从主机访问时,我得到200个状态代码。
我在做什么错?请帮忙。