Skip to content

Instantly share code, notes, and snippets.

@shreyas1496
Created July 2, 2021 08:18
Show Gist options
  • Save shreyas1496/0c2b554d47ae22fab5e88851e079d4be to your computer and use it in GitHub Desktop.
Save shreyas1496/0c2b554d47ae22fab5e88851e079d4be to your computer and use it in GitHub Desktop.
Starts local dynamodb server and ui service to access it using docker compose. Data is persisted accross restarts. Use the variables to configure the ports for the respective services.
version: "3.5"
# Starts local dynamodb server and ui service to access it
# Variables
# DYNAMODB_SERVER_PORT (default 5000)
# DYNAMODB_UI_PORT (default 5001)
services:
dynamo:
container_name: local-dynamodb
image: amazon/dynamodb-local
networks:
- local-dynamodb
ports:
- "${DYNAMODB_SERVER_PORT:-5000}:${DYNAMODB_SERVER_PORT:-5000}"
volumes:
- dynamodata:/home/dynamodblocal
working_dir: /home/dynamodblocal
command: "-jar DynamoDBLocal.jar -port ${DYNAMODB_SERVER_PORT:-5000} -sharedDb -dbPath ."
ui:
container_name: dynamo-ui
image: aaronshaf/dynamodb-admin
networks:
- local-dynamodb
ports:
- "${DYNAMODB_UI_PORT:-5001}:${DYNAMODB_UI_PORT:-5001}"
environment:
- DYNAMO_ENDPOINT=http://local-dynamodb:${DYNAMODB_SERVER_PORT:-5000}
- PORT=${DYNAMODB_UI_PORT:-5001}
- AWS_REGION=eu-west-1
- AWS_ACCESS_KEY_ID=local
- AWS_SECRET_ACCESS_KEY=local
networks:
local-dynamodb:
name: local-dynamodb
volumes:
dynamodata: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment