Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for running DynamoDB within docker #279

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

henhal
Copy link
Contributor

@henhal henhal commented Jan 14, 2022

This adds support for running DynamoDB using docker.
It relies on 99x/dynamodb-localhost#64, which is still open, so this PR is for now for initial discussion on the interface change. And in fact, since options are passed through to dynamodb-localhost, I don't anticipate any changes to be needed except for in the CLI argument parsing and the README. I wanted to get some feedback on if this setup with two additional options is good. :)

Fixes issue #277

Changes: Document docker options and pass to dynamodb-localhost

Demo Link: N/A

Screenshots for the change:

@ixartz
Copy link

ixartz commented Jan 21, 2022

Thank you for merging the other PR!

@AshanFernando, could also review this and merge if it looks good!

@henhal
Copy link
Contributor Author

henhal commented Jan 21, 2022

@ixartz I should add that I should probably test this a bit more, and of course also step the dependency to dynamodb-localhost in package.json, and take any feedback on the options structure etc.

@ixartz
Copy link

ixartz commented Feb 4, 2022

@henhal, Actually I'm good with everything. I have checked your suggested change it looks good to me.
I'm good to quickly have a working version and then, we can improve afterwards.

@henhal
Copy link
Contributor Author

henhal commented Feb 7, 2022

@ixartz @AshanFernando or whom it may concern: I've verified that this works with no further changes, by setting up a project with docker: true in my serverless.yml. So this PR basically just needs to bump the version of dynamodb-localhost as per 99x/dynamodb-localhost#64, once available.

@AshanFernando AshanFernando merged commit 0d44cc7 into 99x:v1 Feb 7, 2022
@AshanFernando
Copy link
Collaborator

@henhal I've merged the PR. Thanks for verifying it.

@sarthakg-newzera
Copy link

Can this also be done for dynamodbStream?

@peebles
Copy link

peebles commented Oct 2, 2022

Am I going crazy? I npm-install this on my x86 Mac (using node14.x and 16.x), and the package.json says 0.2.40, but the README.md makes NO mention of docker:true and setting docker:true in serverless.yml seems to have no effect ... it tries to run java and bombs.

But the README.md here in github does mention docker:true, and the version in package.json is 0.2.40.

After npm-install:

$ grep version node_modules/serverless-dynamodb-local/package.json 
  "version": "0.2.40"
$ grep -i docker node_modules/serverless-dynamodb-local/README.md 
$

In README.md:

...
## Features
* Install DynamoDB Local
* Start DynamoDB Local with all the parameters supported (e.g port, inMemory, sharedDb)
* Table Creation for DynamoDB Local

## Install Plugin
...

@henhal
Copy link
Contributor Author

henhal commented Oct 3, 2022

@peebles You're not crazy. This change requires 99x/dynamodb-localhost#64 - which is merged - but no new release has been made. My PR with the readme changes made it into the master branch, but what's missing is for a maintainer of dynamodb-localhost to make a new release and then for the maintainer of this package to reference that new release in package.json Unfortunately none of those things have been done for many months now.

As a workaround consider #277 (comment)

@peebles
Copy link

peebles commented Oct 3, 2022

The worst part of the issue is the README.md not matching reality. The doc here at serverless.com is taken from the README.md too: https://www.serverless.com/plugins/serverless-dynamodb-local. Spent a long time trying to get it to work before I finally started looking at the source under my node_modules. Perhaps the README should be backed out, until everything gets merged properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants