0

I'm running a SpringBoot (2.2.2.RELEASE) java application with springfox.boot.starter:3.0.0 and when I run it locally from within my Eclipse IDE it works well. The problem is that when I package it as Docker image and run the container then when I try to run http://localhost:8089/swagger-ui/# it displays the default Swagger Petstore example.

Here is my Docket @Bean:

@Configuration
public class SwaggerConfig {

  @Bean
  public Docket api() { //
    return new Docket(DocumentationType.OAS_30) //
        .apiInfo(DEFAULT_API_INFO) //
        .select() //
        .paths(PathSelectors.regex("/error").negate()) //
        .build();
  }
}

Obviously it's something related to running it from within a docker container, any idea what's missing to make it work?

Thank you!

EDIT:

Probably worth mentioning that I use to work with springfox:2.9.2 and it worked well both locally and as Docker container.

4

1 回答 1

0

你能更新你的 Spring Boot 版本吗?Spring Boot 2.2 从 2019 年底开始,SB 2.7 即将到来。更新有什么不同吗?

于 2022-03-04T21:08:25.420 回答