Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .hub.online.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions docs/online.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion modules/openapi-generator-online/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 6 additions & 3 deletions modules/openapi-generator-online/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.