Project for deploying your first app with Docker.
This project assumes that you have Docker installed on Ubuntu OS.
To deploy the application using Docker, follow these steps:
- Clone this project:
git clone [REPOSITORY_URL]
- Change to the cloned directory with the command:
cd [DIRECTORY_NAME]
- Build the Docker image:
docker build -t hello:latest .
- Start the container using the created image:
docker run -d \ --name hello_docker \ --publish 8080:8080 \ hello:latest
We have configured the container to be deployed locally on port 8080, so by accessing http://localhost:8080, you should be able to see our "Hello Docker" application.
Once the container is deployed and its correct operation verified, it is necessary to stop and remove the container to avoid leaving potential vulnerabilities in your system. Use the following commands:
docker ps
// Use this command to verify the ID of the container you have run.docker stop [ID]
// Use this command to stop the container. It's not necessary to type the full ID; if you are not running multiple containers, the first few digits are usually sufficient.docker rm [ID]
// Finally, remove the container.