Giter Site home page Giter Site logo

christianmetz / docker-swaggerui Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 3.0 6 KB

Docker image for the Swagger UI, that supports publishing Swagger Specs via API and volume mount.

Home Page: https://hub.docker.com/r/metz/swaggerui/

License: MIT License

JavaScript 100.00%
swagger-ui swagger-spec api continuous-integration docker-image

docker-swaggerui's Introduction

Docker Swagger UI

Docker Build Status Docker Automated build

metz/swaggerui is a Docker image for the Swagger UI, that supports publishing Swagger Specs via API and volume mount.

Getting started

You can pull and run a pre-built Docker image directly from Dockerhub:

docker run --name swaggerui -p 80:8080 metz/swaggerui

This will start the Swagger UI using the default petstore JSON. Then you can access the Swagger UI directly from a browser:

Publish a custom Swagger Spec

In order to supply your own Swagger Spec (swagger.json), you will need to either publish it via the API or mount it with a volume.

Both solutions can be combined, so that the currently published Swagger Spec will be synced with the mounted directory.

API

For more details about the API, see the API overview.

A new Swagger Spec can be published by sending a POST request with the Swagger JSON in the body to the /publish endpoint:

curl -v -X POST \
	-d @swagger_upload.json \
	-H "Content-Type: application/json" \
	http://localhost:80/publish

Volume

In order to publish the Swagger Spec via filesystem, mount the directory containing the swagger.json as a volume at /swaggerui/swagger:

docker run --name swaggerui -p 80:8080 -v /path/to/spec:/swaggerui/swagger metz/swaggerui
Persistence

Mounting the volume also preserves the Swagger Spec across container shutdown and startup.

Developing

Built With

Technology Version
Swagger UI 3.2.2
NodeJS 8

Swagger UI only supports the Swagger / OpenAPI specification 2.0 as of version 3.x.

Building

In order to build the container manually, execute the following in the checkout directory:

docker build -t metz/swaggerui .

API Reference

This Docker image provides a simple API that allows to retrieve and update the current Swagger Spec that will be displayed by Swagger UI.

Method Endpoint Description
GET / Swagger UI
GET /spec Current Swagger specification
POST /publish Publish a new Swagger specification

Supported tags

Find all available tags on Dockerhub.

Each metz/swaggerui version is tagged. We also have 2 tags for the beta and stable track:

  • latest: latest stable build, this is the latest officially supported release
  • nightly: images built from HEAD periodically. Potentially unstable!

For more information about this image and the functionality it provides, please see the docker-swaggerui GitHub repository.

Licensing

A Project by Christian Metz.
Released under the MIT License.

docker-swaggerui's People

Contributors

christianmetz avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.