Spring Boot
application with Docker
on which database is running.
./gradlew clean build
to run selenium test where host.docker.internal
is not set env variable HOST_FOR_SELENIUM
can be used
Install Docker.
Run the Docker image, by executing the
docker run
command from the terminal:
docker run -d --restart=always --name spring-demo -e POSTGRES_USER=dev -e POSTGRES_PASSWORD=dev -e POSTGRES_DB=spring-demo -p 5432:5432 postgres
--restart=always
always restart docker when we turn on computer--name
name of the container, where will be PostgreSQL-e
system variables by which we create database, user and password-p 5432:5432
option publishes all exposed ports to the host interfaces. In our example, it is port5432
is bothhostPort
andcontainerPort