Swagger UI running in Docker uses internal port; can't use try out function

1k views Asked by At

Using swagger-node I setup a project using Express and swagger-ui-express.

Dockerfile

FROM node:8-alpine

WORKDIR /opt/app

COPY package*.json ./
RUN yarn install
COPY . .

CMD [ "yarn", "start" ]

docker-compose.yaml

version: "3"

services:
  app:
    build: .
    ports:
      - 15000:10010

Starting the container

docker-compose up

The graphical API docs are reachable from the outside at http://localhost:15000/api-docs. However I can't use the "Try it out" function as Swagger takes the internal IP and port.

How can I change this so that the API can be tried from outside the container?

enter image description here

0

There are 0 answers