I try using swagger-ui on docker. It is too easy to build.
docker version : 3.3
docker image : swaggerapi/swagger-ui
. ├── docker-compose.yml └── swagger └── api.yaml
version: '3.3' services: swagger-ui: image: swaggerapi/swagger-ui container_name: swagger-ui ports: - "8001:8080" volumes: - ./swagger:/usr/share/nginx/html/swagger environment: API_URL: swagger/api.yaml
If you use port number 8001, you should change other.
Acocording to my research, docker swagger-ui image seems to use nginx. So, file path is
If you just want to build swagger-ui, I recommend copy swagger editor sample and paste in api.yaml.
Run docker command.
docker-compose up -d
You check http://localhost:8001/ when docker build is completed.
By the way, do you think it is not easy to edit yaml file?
If you use Visual Studio Code, you can use Swagger Viewer. It can see preview of editing file in real time and is comfortable.