From c16825f8bea6fed48e7f79a0223bf1512ab09a34 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 26 Sep 2018 16:53:37 -0400 Subject: [PATCH] check if has port, resolves #365 --- util/Setup/DockerComposeBuilder.cs | 1 + util/Setup/Templates/DockerCompose.hbs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/util/Setup/DockerComposeBuilder.cs b/util/Setup/DockerComposeBuilder.cs index b8757d1d21..5126594abc 100644 --- a/util/Setup/DockerComposeBuilder.cs +++ b/util/Setup/DockerComposeBuilder.cs @@ -66,6 +66,7 @@ namespace Bit.Setup public bool MssqlDataDockerVolume { get; set; } public string HttpPort { get; set; } public string HttpsPort { get; set; } + public bool HasPort => !string.IsNullOrWhiteSpace(HttpPort) || !string.IsNullOrWhiteSpace(HttpsPort); public string CoreVersion { get; set; } = "latest"; public string WebVersion { get; set; } = "latest"; } diff --git a/util/Setup/Templates/DockerCompose.hbs b/util/Setup/Templates/DockerCompose.hbs index 4b969a0a14..cfb84f1b4f 100644 --- a/util/Setup/Templates/DockerCompose.hbs +++ b/util/Setup/Templates/DockerCompose.hbs @@ -120,12 +120,14 @@ services: image: bitwarden/nginx:{{{CoreVersion}}} container_name: bitwarden-nginx restart: always +{{#if HasPort}} ports: {{#if HttpPort}} - '{{{HttpPort}}}:8080' {{/if}} {{#if HttpsPort}} - '{{{HttpsPort}}}:8443' +{{/if}} {{/if}} volumes: - ../nginx:/etc/bitwarden/nginx