Welcome again, my friends, my name is Taras and today I want to show you in this one-minute how to run Swagger API on your Ubuntu 22.04 Linux OS to show your API documentation.
You could open the terminal change directory to a folder where your openapi.yaml file is located. And then execute the following commands:
docker pull swaggerapi/swagger-ui
it will pull a Docker image swaggerapi/swagger-ui.
docker run -p 8080:8080 -v $(pwd)/openapi.yaml:/usr/share/nginx/html/openapi.yaml swaggerapi/swagger-ui
the second command will start swagger-ui container with mounted $(pwd)/openapi.yaml located in current working dierctory and mapped to a file /usr/share/nginx/html/openapi.yaml inside the Docker container. The swagger-ui instance will run on TCP port 8080, so to access it open the URL http://localhost:8080 in your favorite web browser. Change file name to /openapi.yaml and press the Explore button.
This is it. It does the magic.
I will add a link to documentation on the Swagger Docker setup in the first comment to this video.
Thank you for your time and patience.
Please add comments to this video on what subject for a new tutorials I should make.
Add your like or dislike.
Please subscribe to our channel to view more useful how-tos.
Watch video Run online without registration, duration hours minute second in high quality. This video was added by user Linux tutorials 07 July 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,518 once and liked it 12 people.