Browse Source

Assume http only for projects, not containers (#191)

davidfowl/dependencies
David Fowler 7 years ago
committed by GitHub
parent
commit
944027b30c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      samples/multi-project/tye.yaml
  2. 3
      src/Microsoft.Tye.Core/ApplicationFactory.cs
  3. 2
      src/Microsoft.Tye.Hosting/ProxyService.cs

1
samples/multi-project/tye.yaml

@ -17,4 +17,3 @@ services:
image: rabbitmq:3-management image: rabbitmq:3-management
bindings: bindings:
- port: 5672 - port: 5672
protocol: rabbitmq

3
src/Microsoft.Tye.Core/ApplicationFactory.cs

@ -93,7 +93,8 @@ namespace Microsoft.Tye
Protocol = configBinding.Protocol, Protocol = configBinding.Protocol,
}; };
if (binding.ConnectionString == null) // Assume HTTP for projects only (containers may be different)
if (binding.ConnectionString == null && configService.Project != null)
{ {
binding.Protocol ??= "http"; binding.Protocol ??= "http";
} }

2
src/Microsoft.Tye.Hosting/ProxyService.cs

@ -69,7 +69,7 @@ namespace Microsoft.Tye.Hosting
binding.Port = GetNextPort(); binding.Port = GetNextPort();
} }
if (binding.Protocol == "http" || binding.Protocol == null) if (binding.Protocol == "http" || (binding.Protocol == null && service.ServiceType == Model.ServiceType.Project))
{ {
binding.ContainerPort = 80; binding.ContainerPort = 80;
} }

Loading…
Cancel
Save