diff --git a/.hub.online.dockerfile b/.hub.online.dockerfile index 083b84d4ead2..6992dff05094 100644 --- a/.hub.online.dockerfile +++ b/.hub.online.dockerfile @@ -28,7 +28,7 @@ WORKDIR ${TARGET_DIR} COPY --from=builder ${GEN_DIR}/modules/openapi-generator-online/target/openapi-generator-online.jar ${TARGET_DIR}/openapi-generator-online.jar -ENV GENERATOR_HOST=http://localhost +ENV GENERATOR_HOST="" EXPOSE 8080 diff --git a/README.md b/README.md index 6adf7b2c58f3..9106b6d56534 100644 --- a/README.md +++ b/README.md @@ -281,7 +281,7 @@ Example usage: ```sh # Start container at port 8888 and save the container id -> CID=$(docker run -d -p 8888:8080 -e GENERATOR_HOST=http://localhost:8888 openapitools/openapi-generator-online) +> CID=$(docker run -d -p 8888:8080 openapitools/openapi-generator-online) # allow for startup > sleep 10 diff --git a/docs/online.md b/docs/online.md index 417b4099f7d6..9ae4eb9853a0 100644 --- a/docs/online.md +++ b/docs/online.md @@ -23,9 +23,7 @@ Example usage: ```bash # Start container at port 8888 and save the container id -CID=$(docker run -d -p 8888:8080 \ - -e GENERATOR_HOST=http://localhost:8888 \ - openapitools/openapi-generator-online) +CID=$(docker run -d -p 8888:8080 openapitools/openapi-generator-online) # allow for startup sleep 10 diff --git a/modules/openapi-generator-online/Dockerfile b/modules/openapi-generator-online/Dockerfile index 71e238dbb5e6..ae0de1cc2e27 100644 --- a/modules/openapi-generator-online/Dockerfile +++ b/modules/openapi-generator-online/Dockerfile @@ -6,7 +6,9 @@ COPY target/openapi-generator-online.jar /generator/openapi-generator-online.jar # GENERATOR_HOST can be used to determine the target location of a download link. # The default value asumes binding to host via: docker -p 8080:8080 image_name -ENV GENERATOR_HOST=http://localhost:8080 +# Generally, this "just works" without GENERATOR_HOST, and this is provided only as +# a workaround if all else fails. +ENV GENERATOR_HOST="" EXPOSE 8080 diff --git a/modules/openapi-generator-online/README.md b/modules/openapi-generator-online/README.md index b3c5ffc244f1..2c77fa3c69c3 100644 --- a/modules/openapi-generator-online/README.md +++ b/modules/openapi-generator-online/README.md @@ -46,9 +46,12 @@ docker build -t openapitools/openapi-generator-online:latest . Now, run the docker image: ``` -docker run -d -p 8888:8080 \ - -e GENERATOR_HOST=http://localhost:8888 \ - openapitools/openapi-generator-online +docker run -d -p 8888:8080 openapitools/openapi-generator-online ``` The `GENERATOR_HOST` variable is used here to ensure download links generated by the API refer to the proper API location. + +## Environment + +`GENERATOR_HOST` can be set to force the scheme/host/port used for download link generation. In most cases, this environment variable is not +necessary to be set and the download link will be generated to match the originating request. The variable is provided simply as a fallback. \ No newline at end of file