diff --git a/web_api/.env.template b/web_api/.env.template index 07a259d2..45910300 100644 --- a/web_api/.env.template +++ b/web_api/.env.template @@ -10,3 +10,4 @@ # S3_BUCKET="osm-storage" # MONGODB_URI="your-mongodb-uri" # DOMAIN="osm.nimh.nih.gov" +# SSH_KEY_PATH=/home/user/.ssh/... # Path to the SSH key used to access the EC2 instance diff --git a/web_api/deploy.sh b/web_api/deploy.sh index ee3da14e..fe0abd4b 100755 --- a/web_api/deploy.sh +++ b/web_api/deploy.sh @@ -14,6 +14,7 @@ if [ -f .env ]; then exit 1 fi +echo ${SSH_KEY_PATH} # Log in to Docker Hub echo "Logging in to Docker Hub..." @@ -50,7 +51,7 @@ popd # Deploy Docker Compose on the instance echo "Deploying Docker Compose on the instance..." -ssh -o StrictHostKeyChecking=no -i dsst2023.pem ubuntu@$public_dns -p 2222 << EOF +ssh -o StrictHostKeyChecking=no -i $SSH_KEY_PATH ubuntu@$public_dns -p 2222 << EOF mkdir -p ~/app cd ~/app echo "$(<./web_api/compose.yaml)" > compose.yaml