Spring Boot App + H2 (in Memory) not working with Docker Container Spring Boot App + H2 (in Memory) not working with Docker Container docker docker

Spring Boot App + H2 (in Memory) not working with Docker Container


-p 8080:80 Map TCP port 80 in the container to port 8080 on the Docker host.

You are publishing the wrong port.

You should run:

docker run -e DATABASE_SERVER=jdbc:h2:mem:tmpdb -dp 8080:8580 todoapi

Then access it in the host machine as follows

http://localhost:8080