This is a Hello World app. The backend is Java / Micronaut and the frontend is TypeScript / React.
It is fully tested (Jest / Spock) and containeried with Docker. There is a Gitbub Actions workflow to run tests and deploy to Dockerhub.
- Github Actions deploys to AWS
- Create a database to store the docker message
A predictable, consistent, and reliable environment.
A box that contains everything an application needs to run (source code, dependencies, run environment, OS, etc). This container can run the application in isolation. Everything the app needs to run is in the container.
- Virtual Machines
Has it's own full operating system & typically slower - Containers
Share the host's operating system & typically quicker
Containers are built using an Image. Images are made up from several "layers". When docker builds an image, it stores each layer in a cache. So, building subsequent images will become faster!
Includes the OS & sometimes the runtime environment
Built on top of the parent image. Parent Image -> Source Code -> Dependencies -> Run Commands
docker build -t myapp2 .
docker run --name myapp_c1 -p 4000:4000 -d myapp
--name sets the name of the container
-p plus local port:container port
-d to not block the terminal
name of image
docker stop containerName
docker stop containerId
View all running containers:
docker ps
View all containers (including non running containers):
docker ps -a
View all images:
docker images
Deleting an image:
docker image rm imageName
Deleting an image that has a running container
docker image rm imageName -f
Deleting a container
docker container rm containerName
Deleting multiple containers
docker container rm containerName containerName2 containerName3