Skip to content

Commit

Permalink
make port configurable
Browse files Browse the repository at this point in the history
Example usage:
$ docker run -d -p 8000:443 -e DYNAMODB_PORT=443 cnadiminti/dynamodb-local

Use Case:
When putting this container together with lambda for testing you want
dynamodb to be available at 443 instead of 8000.
  • Loading branch information
Martin Schulze authored and Martin Schulze committed Mar 11, 2018
1 parent 95a1ec0 commit 47934a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ WORKDIR /var/dynamodb_local
VOLUME ["/dynamodb_local_db"]

ENV DYNAMODB_VERSION=latest
ENV DYNAMODB_PORT=8000

ENV JAVA_OPTS=

Expand All @@ -20,6 +21,4 @@ COPY ./docker-entrypoint.sh /

ENTRYPOINT ["/docker-entrypoint.sh"]

EXPOSE 8000

CMD ["--sharedDb", "-dbPath", "/dynamodb_local_db", "-port", "8000"]
CMD ["--sharedDb", "-dbPath", "/dynamodb_local_db"]
2 changes: 1 addition & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -e

exec java -Djava.library.path=. ${JAVA_OPTS} -jar DynamoDBLocal.jar "$@"
exec java -Djava.library.path=. ${JAVA_OPTS} -jar DynamoDBLocal.jar -port ${DYNAMODB_PORT} "$@"

0 comments on commit 47934a1

Please sign in to comment.