From f19999329943196be24006bddb8b4b000fb52d7d Mon Sep 17 00:00:00 2001 From: Beatrix Klebe Date: Thu, 22 Feb 2024 13:30:22 -0500 Subject: [PATCH] chore(deps): add docker-compose.yml for DynamoDB Local --- apps/api_accounts/README.md | 17 +++-------------- docker-compose.yml | 9 +++++++++ 2 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 docker-compose.yml diff --git a/apps/api_accounts/README.md b/apps/api_accounts/README.md index c6185291..730b86c8 100644 --- a/apps/api_accounts/README.md +++ b/apps/api_accounts/README.md @@ -21,21 +21,10 @@ end ## Setting Up DynamoDB Local -Download [DynamoDB local](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html). +Make sure you have Docker installed, and then run -``` -(mkdir -p bin/dynamodb && \ -cd bin/dynamodb && \ -curl -O https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz && \ -tar -xzf dynamodb_local_latest.tar.gz && \ -rm dynamodb_local_latest.tar.gz) -``` - -Run the JAR file to start the local DynamoDB server: - -``` -(export DYNAMODB_PATH=./bin/dynamodb && \ -java -Djava.library.path=${DYNAMODB_PATH}/DynamoDBLocal_lib -jar ${DYNAMODB_PATH}/DynamoDBLocal.jar -sharedDb) +```shell +docker compose up ``` Once DynamoDB is running, you can create a new admin user: diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..fe1ba71e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: "3.8" +services: + dynamodb-local: + command: "-jar DynamoDBLocal.jar -sharedDb -inMemory" + image: "amazon/dynamodb-local:2.0.0" + container_name: dynamodb-local + ports: + - "8000:8000" + working_dir: /home/dynamodblocal