swagger-ui Installation
Docker
You can pull a pre-built docker image of the swagger-ui directly from docker.swagger.io:
docker pull docker.swagger.io/swaggerapi/swagger-ui
docker run -p 80:8080 docker.swagger.io/swaggerapi/swagger-ui
Will start nginx with Swagger UI on port 80.
Or you can provide your own swagger.json on your host
docker run -p 80:8080 -e SWAGGER_JSON=/foo/swagger.json -v /bar:/foo docker.swagger.io/swaggerapi/swagger-ui
You can also provide a URL to a swagger.json on an external host:
docker run -p 80:8080 -e SWAGGER_JSON_URL=https://petstore3.swagger.io/api/v3/openapi.json docker.swagger.io/swaggerapi/swagger-ui
The base URL of the web application can be changed by specifying the BASE_URL environment variable:
docker run -p 80:8080 -e BASE_URL=/swagger -e SWAGGER_JSON=/foo/swagger.json -v /bar:/foo docker.swagger.io/swaggerapi/swagger-ui
This will serve Swagger UI at /swagger instead of /.
You can specify a different port via PORT variable for accessing the application, default is 8080.
docker run -p 80:80 -e PORT=80 docker.swagger.io/swaggerapi/swagger-ui
You can specify an IPv6 port via PORT_IPV6 variable. By default, IPv6 port is not set.
docker run -p 80:80 -e PORT_IPV6=8080 docker.swagger.io/swaggerapi/swagger-ui
You can allow/disallow embedding via EMBEDDING variable. By default, embedding is disabled.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
docker run -p 80:80 -e EMBEDDING=true docker.swagger.io/swaggerapi/swagger-ui
For more information on controlling Swagger UI through the Docker image, see the Docker section of the Configuration documentation.
https://github.com/swagger-api/swagger-ui/blob/fceaec605072fbc717a04895bd19814d9a1c8e6d/docs/usage/configuration.md#docker
Source:
https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/usage/installation.md