File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
playground/publishers/Publishers.AppHost
src/Aspire.Hosting.Docker Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,6 @@ services:
6767 P2 : " ${PARAM2}"
6868 P3 : " ${PARAM3}"
6969 services__api__http__0 : " http://api:8005"
70- services__api__https__0 : " https://api:8007"
7170 ports :
7271 - " 8011:8010"
7372 - " 8013:8012"
Original file line number Diff line number Diff line change @@ -321,6 +321,8 @@ private async Task ProcessEnvironmentAsync(DistributedApplicationExecutionContex
321321 await c . Callback ( context ) . ConfigureAwait ( false ) ;
322322 }
323323
324+ RemoveHttpsServiceDiscoveryVariables ( context . EnvironmentVariables ) ;
325+
324326 foreach ( var kv in context . EnvironmentVariables )
325327 {
326328 var value = await ProcessValueAsync ( kv . Value ) . ConfigureAwait ( false ) ;
@@ -329,6 +331,23 @@ private async Task ProcessEnvironmentAsync(DistributedApplicationExecutionContex
329331 }
330332 }
331333 }
334+
335+ private static void RemoveHttpsServiceDiscoveryVariables ( Dictionary < string , object > environmentVariables )
336+ {
337+ // HACK: At the moment Docker Compose doesn't do anything with setting up certificates so
338+ // we need to remove the https service discovery variables.
339+
340+ var keysToRemove = environmentVariables
341+ . Where ( kvp => kvp . Value is EndpointReference epRef && epRef . Scheme == "https" && kvp . Key . StartsWith ( "services__" ) )
342+ . Select ( kvp => kvp . Key )
343+ . ToList ( ) ;
344+
345+ foreach ( var key in keysToRemove )
346+ {
347+ environmentVariables . Remove ( key ) ;
348+ }
349+ }
350+
332351 private void ProcessVolumes ( )
333352 {
334353 if ( ! resource . TryGetContainerMounts ( out var mounts ) )
You can’t perform that action at this time.
0 commit comments