For overview of Swagger tools refer Swagger - OpenAPI Specification (OAS)
Installing Swagger UI - Docker
Pull the docker image - docker pull swaggerapi/swagger-uiRun the docker image - docker run -p 80:8080 swaggerapi/swagger-ui
Customisation :
To the above command lets add some customisation,
- BASE_URL : To customise the URL to specific keywords.
- SWAGGER_JSON : Specify your json files generated from the editor.
docker run -p 8080:8080 -e BASE_URL=/swaggerUI -e SWAGGER_JSON=/apispecs/swagger.json -v /apispecs:/apispecs swaggerapi/swagger-ui
Installing Swagger Editor - Docker
docker run -p 8081:8080 -v /apispecs:/apispecs swaggerapi/swagger-editor
Installing Swagger UI & Editor - Docker compose
- Create a docker-compose.yml
- Create a swagger definition file.
Swagger Editor - https://localhost:8001
sushilpawar@mac:~/swagger-docker$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
41172951931f swaggerapi/swagger-ui "/docker-entrypoint.…" 4 hours ago Up 4 hours 80/tcp, 0.0.0.0:8701->8080/tcp, :::8701->8080/tcp swagger-ui
9cba0f530971 swaggerapi/swagger-editor "/docker-entrypoint.…" 4 hours ago Up 4 hours 80/tcp, 0.0.0.0:8700->8080/tcp, :::8700->8080/tcp swagger-editor
0 Comments