Whitelabel Error Page while try to connect to h2 from Docker

Viewed 30

Helo everyone. I try to resolve this problem for about several hours... and it seems to me it got under my skin. I run doker file, its working and I can send request to endpoinds via swagger. Having analised obtained data I was sure that h2 was working under the hood. Without docker everything is fine, I mean h2 and swagger are working. Maybe someone has some guesses.

application.properties:

spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect

# Enabling H2 Console
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
spring.h2.console.settings.trace=true 
spring.h2.console.settings.web-allow-others=true
spring.jpa.hibernate.ddl-auto=none

privateBankApiLink=https://api.privatbank.ua/p24api/pubinfo?json&exchange&coursid=5
spring.mvc.pathmatch.matching-strategy=ant_path_matcher

And Dockerfile:

FROM openjdk:17-jdk-alpine
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java", "-jar", "/app.jar", "-web -webAllowOthers -tcp -tcpAllowOthers -browser"]
EXPOSE 8080
1 Answers

solved the problem. It needs to open console with http://localhost:(localport)/h2 ("sa" , withot password). God, I tried to open with h2-console, as before

Related