This guide provides step-by-step instructions for building and managing Docker containers in the backend
directory of BoardMaster. It is intended for developers who are not familiar with basic Docker commands and BoardMaster's environment.
Docker installed on your machine.
Basic understanding of Docker commands.
Ensure you are in the backend
directory of the project.
To build the Docker image:
gradlew bootBuildImage --imageName=cogito/boardmaster
This command builds a Docker image based on the specifications in your Dockerfile.
To run the Docker image:
docker run -p 8080:8080 -t cogito/boardmaster
This command starts the containers defined in your docker-compose.yml.
In a production environment, it's best to run the Docker container in detached mode:
docker run --detach -p 8080:8080 -t cogito/boardmaster
This runs your container in the background. If one does not do this the process will be removed when the terminal is closed or after a certain amount of time of inactivity.
To stop and remove containers, networks, and images created by up:
docker kill {container_id}
To list all running Docker containers:
docker ps
This displays a list of all active containers along with their status.