Container-Based DynamoDB-Local Datastore and Hybrid Web-Application Server.
* Build
sudo docker build --no-cache -t hybridserver/ubuntu-22.04-nodejs-21-python-3.11-aws-cli-2:latest .
* Deploy containers
set PWD=%cd% && sudo docker compose -f docker-compose-dyndb.yml --project-directory $PWD --project-name "dyndb-app" up -d
* Stop and remove containers with related network and volumes
set PWD=%cd% && sudo docker compose -f docker-compose-dyndb.yml --project-directory $PWD --project-name "dyndb-app" down && sudo docker volume rm $(docker volume ls -q)
* Stop services
set PWD=%cd% && sudo docker compose -f docker-compose-dyndb.yml --project-directory $PWD --project-name "dyndb-app" stop
* Start services
set PWD=%cd% && sudo docker compose -f docker-compose-dyndb.yml --project-directory $PWD --project-name "dyndb-app" start
* Log: view output from containers
set PWD=%cd% && sudo docker compose -f docker-compose-dyndb.yml --project-directory $PWD --project-name "dyndb-app" logs
* DynamoDB-Local Node
sudo docker logs dynamodb-node
* Web-App Server Node
sudo docker logs webappserver-node
* DynamoDB-Local Node
sudo docker inspect dynamodb-node
sudo docker exec -it dynamodb-node /bin/bash -c "tail -n 400 -f /var/log/dnf.log"
sudo docker exec -it dynamodb-node /bin/bash -c "tail -n 400 -f /var/log/dnf.rpm.log"
* Web-App Server Node
sudo docker inspect webappserver-node
sudo docker exec -it dynamodb-node /bin/bash -c "tail -n 400 -f /var/log/hawkey.log"
sudo docker exec -it webappserver-node /bin/bash -c "sudo tail -n 400 -f /var/log/alternatives.log"
sudo docker exec -it webappserver-node /bin/bash -c "sudo tail -n 400 -f /var/log/bootstrap.log"
sudo docker exec -it webappserver-node /bin/bash -c "sudo tail -n 400 -f /var/log/dpkg.log"
sudo docker exec -it webappserver-node /bin/bash -c "sudo tail -n 400 -f /var/log/apt/history.log"
sudo docker exec -it webappserver-node /bin/bash -c "sudo tail -n 400 -f /var/log/apt/term.log"
* DynamoDB-Local Node
sudo docker exec -it dynamodb-node /bin/bash
* Web-App Server Node
sudo docker exec -it webappserver-node /bin/bash
sudo docker exec -it webappserver-node /bin/bash -c "sudo aws dynamodb describe-limits --endpoint-url http://dynamodb-node:8000 --region us-east-1"
sudo docker exec -it webappserver-node /bin/bash -c "sudo aws dynamodb list-tables --endpoint-url http://dynamodb-node:8000 --region us-east-1"
sudo docker exec -it webappserver-node /bin/bash -c "sudo aws dynamodb create-table --table-name cars --attribute-definitions AttributeName=manufacturer,AttributeType=S AttributeName=model,AttributeType=S --key-schema AttributeName=manufacturer,KeyType=HASH AttributeName=model,KeyType=RANGE --billing-mode PAY_PER_REQUEST --endpoint-url http://dynamodb-node:8000 --region us-east-1 --profile default"
sudo docker exec -it webappserver-node /bin/bash -c "sudo curl http:/localhost:80"
* DynamoDB-Local Node
sudo docker stop dynamodb-node
sudo docker start dynamodb-node
* Web-App Server Node
sudo docker stop webappserver-node
sudo docker start webappserver-node
* sudo docker ps -a
Copyright © 2024. MongoExpUser
Licensed under the MIT license.