Setting Up DynamoDB locally

Setting Up DynamoDB locally

The Docker version of DynamoDB lets you write and test applications without AWS account. As a DevOps, one should provide a similar Development environment to each developer as running in production which is the end goal of every DevOps Team. Another advantage is, you can run without connecting AWS every time and save cost as well. When you're ready to deploy your application in production, you just need to change the Endpoint in your code so that it uses the DynamoDB web service.


No alt text provided for this image


I assume that the Docker is already installed, All you have to run this command and that's it.

 docker run -p 8000:8000 amazon/dynamodb-local


But, The issue with the above docker image is, you can't change the port from `8000` thousand which is sometimes required in the development environment. And it's really hard to override the Entry point or change anything as per your need in AWS services.

No alt text provided for this image


So this section is the backbone of this article, as our requirement is starting Dynamo DB some other port then `8000`. Here I am going run container using port `8003`, but keep in mind that base image is still AWS offical image, you can create one but its again required effort to keep it up to date.

DockerFile:

FROM amazon/dynamodb-local
WORKDIR /home/dynamodblocal
ENTRYPOINT ["java", "-jar", "DynamoDBLocal.jar", "-port", "8003"]

Now you are good to go to build the Docker.

docker build -t mydynamodb .

Run the Container

docker run -dit --name mydynamodb mydynamodb
No alt text provided for this image


Once the Dynamo DB is up, You will be able to see the logs and the port that is 8003.


No alt text provided for this image




Ibrahim S.

NodeJS | Serverless | AWS | Terraform | Docker

5 年

really helpful, thanks (y)

Great post man!! love the memes you post in-between haha

要查看或添加评论,请登录

Adil M的更多文章

  • Start Node application with different process manager based on ENV

    Start Node application with different process manager based on ENV

    Nodejs application often depended on Environment variables and in normal cases it is fine but in case of Docker, I will…

    3 条评论
  • The King of modern Process manager

    The King of modern Process manager

    Pm2 will help you to diagnose the issues in your servers in a day where the developers fails to investigate in a month.…

    2 条评论
  • Get rid of Docker "exec"

    Get rid of Docker "exec"

    The docker exec command provides the much-needed help to users while debugging and checking logs of the container and…

    8 条评论
  • Simple, fun and dynamic SSH

    Simple, fun and dynamic SSH

    The hardest moment is when the server goes down and you just received a call from you monitoring serves and it's around…

    3 条评论
  • RDS is available, Thanks Slack! [ReadTime 2 minutes]

    RDS is available, Thanks Slack! [ReadTime 2 minutes]

    There are other ways around to get a notification when RDS is available but that might be email or SNS etc, Its take a…

    1 条评论
  • Create DynamoDB in 30 Seconds [Readtime 4 mint]

    Create DynamoDB in 30 Seconds [Readtime 4 mint]

    In my previous article, I shared about how to run DynamoDB locally using Docker, In today article I am going to share…

    1 条评论
  • Configure Multiple Environments from the Same DockerFile [Part 1]

    Configure Multiple Environments from the Same DockerFile [Part 1]

    Everyone moving toward Docker because Docker is awesome :). But when its come to run in a different environment for…

    4 条评论
  • Terraform (AWS) mistakes to avoid

    Terraform (AWS) mistakes to avoid

    provider "aws" { region = "us-west-2" access_key = var.credentials.

  • The Flaws of the average when collecting System Metrics

    The Flaws of the average when collecting System Metrics

    The above picture tells the whole story, this is what happened to us when we were collecting the average CPU usage. We…

    3 条评论

社区洞察

其他会员也浏览了