version: '3.8'

services:
  ui:
    image: swaggerapi/swagger-ui
    container_name: shop-swagger-ui
    ports: ["8080:8080"]
    environment:
      SWAGGER_JSON: /spec/openapi.yaml
      DOC_EXPANSION: list
      DEEP_LINKING: "true"
      DISPLAY_REQUEST_DURATION: "true"
    volumes:
      - ./openapi.yaml:/spec/openapi.yaml:ro

  editor:
    image: swaggerapi/swagger-editor
    container_name: shop-swagger-editor
    ports: ["8081:8080"]
    volumes:
      - ./openapi.yaml:/tmp/openapi.yaml:ro
    environment:
      SWAGGER_FILE: /tmp/openapi.yaml

  mock:
    image: stoplight/prism:4
    container_name: shop-mock
    ports: ["4010:4010"]
    command: mock -h 0.0.0.0 /spec/openapi.yaml
    volumes:
      - ./openapi.yaml:/spec/openapi.yaml:ro

  redoc:
    image: redocly/redoc
    container_name: shop-redoc
    ports: ["8082:80"]
    environment:
      SPEC_URL: openapi.yaml
    volumes:
      - ./openapi.yaml:/usr/share/nginx/html/openapi.yaml:ro
