Last active
January 31, 2020 01:20
-
-
Save gjhuerte/672cd30599dde0f36911ca1e8f313f87 to your computer and use it in GitHub Desktop.
Installing DynamoDB on Homestead
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
# We need to update first the repository | |
# to check for missing packages etc.. | |
# | |
# Run the following command if ever possible | |
sudo apt update; | |
# Install the necessary packages for the dynamodb | |
# unzip - unzips the zip file for us to open it up | |
# openjdk - java package for us to run jar files | |
# | |
# Then we'll install the dynamodb-admin for the gui | |
# And export the port that we'll be using for the dynamodb-admin | |
sudo apt install unzip openjdk-11-jre-headless; | |
curl -o /opt/dynamodb-server.zip https://s3-ap-northeast-1.amazonaws.com/dynamodb-local-tokyo/dynamodb_local_latest.zip | |
unzip /opt/dynamodb-server.zip -d /opt/dynamodb-server | |
npm install dynamodb-admin -g | |
export DYNAMO_ENDPOINT=http://localhost:8099 | |
# We will require pm2 to run the services | |
# Install pm2 through node package manager | |
npm install pm2 -g | |
# Now well add the process to pm2 | |
# The first part is for the server and the next | |
# is for the admin. Please do change the name/port | |
# depending on what you prefer | |
pm2 start 'java -Djava.library.path=/opt/dynamodb-server/DynamoDBLocal_lib -jar /opt/dynamodb-server/DynamoDBLocal.jar -sharedDb --port 8099' --name dynamodb-server; | |
pm2 start 'export DYNAMO_ENDPOINT=http://localhost:8099;dynamodb-admin --port 8098' --name dynamodb-admin; | |
pm2 startup; | |
pm2 save; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment