Skip to content

Docker support #10403

Open
Open
@OlegKunitsyn

Description

@OlegKunitsyn

Problem

Swagger UI can't show OpenAPI specs from services running inside the Docker network.

Solution

30 lines for Nginx: https://gitlab.com/plgrnd/swagger-ui/-/blob/main/embedding.conf

Usage

 swagger-ui:
   image: swagger-ui:latest
   environment:
     URLS: '[{"url":"/service-a:8000/v3/api-docs", "name":"service-a"},{"url":"/service-b:9000/v3/api-docs", "name":"service-b"}]'
   ports:
     - "8080:8080"

Result

Start the services and open http://localhost:8080 in your browser. The Servers drop-down will now include option Proxied server url.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions