ResourceHub API. Not for production. Get/Post, Json Serialize/Deserialize
This commit is contained in:
34
ResourceHub/Database/run.sh
Executable file
34
ResourceHub/Database/run.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if .env file already exists
|
||||
if [ -f .env ]; then
|
||||
echo ".env file already exists. Starting Docker Compose..."
|
||||
else
|
||||
# Prompt the user for the Redis password
|
||||
read -p "Set a Redis port: " REDIS_PORT
|
||||
read -p "Enter your new Redis password: " REDIS_PASSWORD
|
||||
echo
|
||||
|
||||
# Create the .env file and write the password
|
||||
cat <<EOL > .env
|
||||
REDIS_PORT=$REDIS_PORT
|
||||
REDIS_PASSWORD=$REDIS_PASSWORD
|
||||
|
||||
EOL
|
||||
|
||||
# Inform the user
|
||||
|
||||
echo ".env file created"
|
||||
echo
|
||||
echo "--------------------------------------------------------------"
|
||||
echo "Redis Database accesed with URI: http://127.0.0.1:$REDIS_PORT"
|
||||
echo "Redis password is: $REDIS_PASSWORD"
|
||||
echo "--------------------------------------------------------------"
|
||||
fi
|
||||
|
||||
# Start Docker Compose
|
||||
docker-compose up -d
|
||||
|
||||
# show docker container
|
||||
echo
|
||||
docker ps
|
||||
Reference in New Issue
Block a user