Skip to content

Commit

Permalink
fix(docker): enable IPv6 explicitly by env variable (#8449)
Browse files Browse the repository at this point in the history
Enabling IPv6 address and port for IPv6 addresses
caused backward incompatible issues in the docker image.
If one wants to use it, it must be turned on explicitly
with PORT_IPV6 env variable.

Refs #8447
Refs #8437
  • Loading branch information
char0n committed Mar 7, 2023
1 parent 7869722 commit 51f8ccb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docker/docker-entrypoint.d/40-swagger-ui.sh
Expand Up @@ -39,6 +39,11 @@ if [[ -f "$SWAGGER_JSON" ]]; then
sed -i "s|http://example.com/api|$REL_PATH|g" $INITIALIZER_SCRIPT
fi

# enable/disable the address and port for IPv6 addresses that nginx listens on
if [[ -n "${PORT_IPV6}" ]]; then
sed -i "s|8080;|8080;\n listen [::]:${PORT_IPV6};|g" $NGINX_CONF
fi

# replace the PORT that nginx listens on if PORT is supplied
if [[ -n "${PORT}" ]]; then
sed -i "s|8080|${PORT}|g" $NGINX_CONF
Expand Down
1 change: 0 additions & 1 deletion docker/nginx.conf
Expand Up @@ -30,7 +30,6 @@ http {

server {
listen 8080;
listen [::]:8080;
server_name localhost;
index index.html index.htm;

Expand Down

0 comments on commit 51f8ccb

Please sign in to comment.