Skip to content

Latest commit

 

History

History
60 lines (37 loc) · 2.1 KB

04.docker.md

File metadata and controls

60 lines (37 loc) · 2.1 KB

Docker Containerization

Ensure Docker is installed and operational in your local environment.

Docker Advantages:

Building the Docker Image:

To construct the Docker image with the complete build process:

docker build -t kcrud-image -f ./docker-full-build.Dockerfile .

For using a pre-existing fat JAR (expected to be located in the build/libs directory):

docker build -t kcrud-image -f ./docker-no-build.Dockerfile .

Using Docker Compose:

Docker Compose simplifies setup and deployment by automating service build and initialization, as specified in the provided docker-compose.yaml, including port mapping and environment variable settings.

To deploy services with Docker Compose and ensure old unused containers are cleaned up:

docker-compose up --build --remove-orphans

To rebuild the Docker image and restart the container, use the --build flag:

docker-compose build --no-cache

Note: The --build option forces the image to rebuild. The --remove-orphans flag removes containers for services not defined in the Compose file.

IntelliJ IDEA Ultimate Integration:

For users of IntelliJ IDEA Ultimate, many of these Docker and Docker Compose commands can be run directly from the IDE, which provides a convenient and integrated workflow for building images, starting services, and managing containers.

Testing the Application:

After the container is running, observe the console output. Once initialization is complete, you can test the server by opening a web browser and navigating to any of the following URLs:

http://localhost:8080

http://localhost:8080/demo?page=0&size=24

http://localhost:8080/health

http://localhost:8080/rbac/login