๐ DynamoDB Local with Docker Setup
September 17, 2024 ยท View on GitHub
This guide will help you get a local version of DynamoDB running with Docker and show you how to interact with it using the AWS CLI. Perfect for testing your app or playing around with AWS DynamoDB without any AWS charges.
๐ ๏ธ What's in this Setup?
We can use Docker Compose to launch two services:
1. DynamoDB Local
- Purpose: A local version of DynamoDB running inside a Docker container.
- Port: Accessible on your machine at
http://localhost:8000. - Why: You can test DynamoDB operations without connecting to the AWS Cloud.
2. AWS CLI (App-Node)
- Purpose: Runs the AWS CLI inside Docker to interact with DynamoDB Local.
- Command: Runs a sample command to check DynamoDB limits (
describe-limits). - Environment: Uses dummy AWS credentials (since you're working locally).
๐ How to Get Started
-
Install Docker ๐ณ
Make sure youโve got Docker installed on your machine.
๐ Get Docker here -
Clone or Download this Repo
Copy thedocker-compose.ymlfile to your project folder. -
Run the services
Open a terminal, navigate to your project folder, and run:docker-compose up๐ข This starts DynamoDB on
http://localhost:8000and runs the AWS CLI command to check DynamoDBโs limits. -
Check DynamoDB Tables
In a new terminal, run this command to see the tables in your local DynamoDB:aws dynamodb list-tables --endpoint-url http://localhost:8000 --region us-west-2You should get an empty list if no tables are created yet.
-
Stop the services
When you're done, shut everything down with:docker-compose down