Skip to content

Commit 645f2b6

Browse files
committed
use persistent docker dynamodb
1 parent 9eef07b commit 645f2b6

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM amazon/dynamodb-local
2+
3+
WORKDIR /home/dynamodblocal
4+
5+
RUN mkdir ./db && chown -R 1000 ./db
6+
7+
CMD ["-jar", "DynamoDBLocal.jar", "-dbPath", "./db", "-sharedDb"]
8+
VOLUME ["./db"]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: "3"
2+
3+
services:
4+
dynamodb:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
ports:
9+
- 8000:8000
10+
volumes:
11+
- aws-rest-api-dynamodb:/home/dynamodblocal/db
12+
13+
volumes:
14+
aws-rest-api-dynamodb:
15+
driver: local

aws-node-rest-api-with-dynamodb-and-offline/serverless.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ custom:
1414
port: 8000
1515
inMemory: true
1616
migrate: true
17+
# Comment if you don't have a DynamoDB running locally
18+
noStart: true
1719
migration:
1820
dir: offline/migrations
1921

0 commit comments

Comments
 (0)