Last active
October 7, 2021 18:09
-
-
Save neilkidd/fba9bc6af19f6bf8e930c004d022cd15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.8" | |
services: | |
dynamodb-local: | |
container_name: app-dynamodb-local | |
command: "-jar DynamoDBLocal.jar -sharedDb -inMemory" | |
image: amazon/dynamodb-local | |
ports: | |
- "8000:8000" | |
# restart: unless-stopped | |
dynamodb-admin: | |
image: aaronshaf/dynamodb-admin | |
ports: | |
- "8001:8001" | |
environment: | |
- DYNAMO_ENDPOINT=http://host.docker.internal:8000 | |
depends_on: | |
- dynamodb-local | |
awscli-dynamodb-migrator: | |
image: amazon/aws-cli | |
command: | | |
dynamodb create-table | |
--table-name casbin-table-dev | |
--attribute-definitions AttributeName=id,AttributeType=S | |
--key-schema AttributeName=id,KeyType=HASH | |
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 | |
--endpoint-url http://host.docker.internal:8000 | |
environment: | |
- AWS_ACCESS_KEY_ID=unused | |
- AWS_SECRET_ACCESS_KEY=unused | |
- AWS_DEFAULT_REGION=us-east-1 | |
depends_on: | |
- dynamodb-local | |
# restart: unless-stopped |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Changed the dynamodb instance to have a command that loses the data each run and shares all tables.
command: "-jar DynamoDBLocal.jar -sharedDb -inMemory"
In practice the
-inMemory
option can be removed to persist the data and themigrator
fails safely.Switched to using
http://host.docker.internal:8000
to work around oddities of running docker inside wsl2.Need to comfirm this works on a mac please 🙇