diff --git a/docker-unified/Dockerfile b/docker-unified/Dockerfile index 42509bc990..aa02ec890d 100644 --- a/docker-unified/Dockerfile +++ b/docker-unified/Dockerfile @@ -202,8 +202,6 @@ ENV globalSettings__send__baseDirectory="/etc/bitwarden/attachments/send" ENV globalSettings__licenseDirectory="/etc/bitwarden/licenses" ENV globalSettings__logDirectoryByProject="false" ENV globalSettings__logRollBySizeLimit="1073741824" -EXPOSE 80 -EXPOSE 443 # Add packages RUN apk add --update-cache \ @@ -288,5 +286,4 @@ VOLUME ["/etc/bitwarden"] WORKDIR /app USER bitwarden:bitwarden -HEALTHCHECK CMD curl --insecure -Lfs https://localhost/alive || curl -Lfs http://localhost/alive || exit 1 ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker-unified/docker-compose.yml b/docker-unified/docker-compose.yml index 0acbba9eb4..25e3bcd038 100644 --- a/docker-unified/docker-compose.yml +++ b/docker-unified/docker-compose.yml @@ -10,8 +10,8 @@ services: image: ${REGISTRY:-bitwarden}/self-host:${TAG:-beta} restart: always ports: - - "80:80" - - "443:443" + - "80:8080" + - "443:8443" volumes: - bitwarden:/etc/bitwarden - logs:/var/log/bitwarden diff --git a/docker-unified/hbs/nginx-config.hbs b/docker-unified/hbs/nginx-config.hbs index f5b76c2486..5a69352c42 100644 --- a/docker-unified/hbs/nginx-config.hbs +++ b/docker-unified/hbs/nginx-config.hbs @@ -1,15 +1,15 @@ server { - listen 80 default_server; - #listen [::]:80 default_server; + listen {{{String.Coalesce env.BW_PORT_HTTP "8080"}}} default_server; + #listen [::]:{{{String.Coalesce env.BW_PORT_HTTP "8080"}}} default_server; server_name {{{String.Coalesce env.BW_DOMAIN "localhost"}}}; {{#if (String.Equal env.BW_ENABLE_SSL "true")}} - return 301 https://{{{String.Coalesce env.BW_DOMAIN "localhost"}}}$request_uri; + return 301 https://{{{String.Coalesce env.BW_DOMAIN "localhost"}}}:{{{String.Coalesce env.BW_PORT_HTTPS "8443"}}}$request_uri; } server { - listen 443 ssl http2; - #listen [::]:443 ssl http2; + listen {{{String.Coalesce env.BW_PORT_HTTPS "8443"}}} ssl http2; + #listen [::]:{{{String.Coalesce env.BW_PORT_HTTPS "8443"}}} ssl http2; server_name {{{String.Coalesce env.BW_DOMAIN "localhost"}}}; ssl_certificate /etc/bitwarden/{{{String.Coalesce env.BW_SSL_CERT "ssl.crt"}}}; diff --git a/docker-unified/settings.env b/docker-unified/settings.env index a789e7aa4b..17e9be4bcb 100644 --- a/docker-unified/settings.env +++ b/docker-unified/settings.env @@ -23,6 +23,10 @@ BW_INSTALLATION_KEY=xxxxxxxxxxxx ##################### # Learn more here: https://bitwarden.com/help/environment-variables/ +# Webserver ports +#BW_PORT_HTTP=8080 +#BW_PORT_HTTPS=8443 + # SSL #BW_ENABLE_SSL=true #BW_ENABLE_SSL_CA=true