-
Notifications
You must be signed in to change notification settings - Fork 236
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
Rely on docker for local dynamodb #57
Comments
You should be able to use a docker container. Skip the first two steps( |
That's how I'm doing this, would be nice though to have it in package. |
I'm using dockerized ddb and node app (combined in docker-compose). |
Turns out the above syntax error is a side effect of a request that fails to reach ddb and returns |
In case it's helpful to anyone coming from a Google search for "serverless dynamodb local with Docker", this configuration let's you find the right docker container, skip the plugin's startup step and run a migration: custom:
dynamodb:
start:
host: dynamo # or the name of your Dynamo docker container
port: "8000" # the port of our Dynamo docker container
noStart: true
migrate: true |
I had to specify the image instead of host: custom:
dynamodb:
start:
image: dynamo # or the name of your Dynamo docker container
port: "8000" # the port of our Dynamo docker container
noStart: true
migrate: true |
@kjersten |
@AntonioCS you can specify which stage this runs on:
Is that what you need? |
I am running successfully a container with dynamodb-local. It also seems the migration and seed are correctly performed, but at the moment my tests run, they do not find any table. Here is the error I get:
I have checked the DB vía web and, certainly, there is nothing. Has anyone a hint? |
@cyberwombat Thanks but I just created another |
I am also having this problem. The weird thing is that if I execute a shell in the container running the serverless application and run Serverless: DynamoDB - Warn - table xxxxx already exists
Serverless: DynamoDB - Warn - table xxxxx already exists
Serverless: DynamoDB - Warn - table xxxxx already exists But my app still says it does not have the tables created. Even, if I go to the shell, no table has been created. Very weird. |
@jorchg Could you have possibly installed DynamoDB local as well? Perhaps you have both a local instance and a docker instance running |
I have just found that I have to start the dynamodb-local docker image with the dynamodb:
image: 'amazon/dynamodb-local'
ports:
- '8000:8000'
command: ["-jar", "DynamoDBLocal.jar", "-sharedDb", "-inMemory"] That solved the problem :) |
The option "in memory" seems to be active by default in the docker image, but it is the "share DB" which makes the trick... Thanks for your help! |
just to be clear if anyone gets here - with @kjersten |
Could this plugin switch to relying on docker or better yet docker-compose so I would have to have blobal JDK installation for DynamoDB?
The text was updated successfully, but these errors were encountered: