A Swagger-UI which periodically polls configuration from an URL.
You must set the following environment variables to run the Docker container:
POLL_URL
: URL pointing towards a swagger configuration file (see configuration / swagger)
It optionally accepts the following arguments:
POLL_INTERVAL_SECONDS
: The refresh interval in seconds.- Default is 300 (5 minutes).
SWAGGER_ROOT
: The swagger root folder, if using custom nginx configuration.- Default ist
/usr/share/nginx/html
.
- Default ist
The default exposed port is 8080.
The image uses Node.js internally for polling. You can add any environment variables you like to configure the Node.js
process. E.g. add custom truststore via NODE_EXTRA_CA_CERTS
etc.
Because of a known issue the swagger
configuration currently has to be in json
-format. yaml
does not work. A sample swagger-config.json
:
{
"urls": [
{
"url": "https://raw.githubusercontent.com/bbortt/swagger-ui-demo/master/files/pet-api.json",
"name": "PetAPI"
},
{
"url": "https://raw.githubusercontent.com/bbortt/swagger-ui-demo/master/files/store-api.json",
"name": "StoreAPI"
}
],
"urls.primaryName": "PetAPI"
}
The following command demonstrates a sample container start:
docker run \
--rm \
-p 80:8080 \
-e POLL_INTERVAL_SECONDS=60 \
-e POLL_URL=https://raw.githubusercontent.com/bbortt/swagger-ui-demo/master/swagger-config.json \
postfinance/polling-swagger-ui:$RELEASE_VERSION
Contributors may find help in
the DEVELOPMENT.md
. It contains
useful resources on how to behave when contributing, so we can accept your pull-requests without big trouble 😉
This project is licensed under the terms of the MIT License.