GET /api/bookmarks <- get all
GET /api/bookmarks/{id} <- get by id
GET /api/bookmarks?query=k&page=2 <- search
POST /api/bookmarks <- create
PUT /api/bookmarks/{id} <- replace by id
PATCH /api/bookmarks/{id} <- partial update by id
DELETE /api/bookmarks/{id} <- delete by id
POST /api/bookmarks
Request Payload:
{
"title": "SivaLabs Blog",
"url": "https://sivalabs.in"
}
Response StatusCode: 201
Payload:
{
"id": 1,
"title": "SivaLabs Blog",
"url": "https://sivalabs.in"
}
$ git clone https://github.com/sivaprasadreddy/myapp.git
$ cd myapp
$ docker-compose up -d
$ docker-compose logs -f
$ cd myapp
$ ./run.sh start
$ ./run.sh stop
Docker is a containerization technology to package and distribute applications.
The infamous
"It works on my machine"
problem
Example Dockerfile
FROM eclipse-temurin:17-jre-focal
COPY target/myapp-1.0.0.jar /apps/myapp.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/apps/myapp.jar"]
If Docker Image is a "class" then "container" is an instance of that class.
# Create Docker Image
$ docker build -t username/myapp .
# Create 1st container
$ docker run --name app1 -p 8081:8080 -d username/myapp
# Create 2nd container
$ docker run --name app2 -p 8082:8080 -d username/myapp
# Creating volume and mount it to container
docker volume create my-vol
docker run -d -v my-vol:/app nginx:latest
# Bind a host file system path to container
docker run -d -v /some/host/dir/path:/app nginx:latest
Run multiple Docker containers
version: "3.9"
services:
myapp:
image: my_web_app:latest
depends_on:
- db
- cache
db:
image: postgres:latest
cache:
image: redis:latest
Kubernetes is a container orchestration platform.
Reference: Kind Docs
Reference: K8S Lens