ResourceHub API. Not for production. Get/Post, Json Serialize/Deserialize

This commit is contained in:
SocioCyber
2026-03-03 06:44:24 -07:00
commit 8a4b324832
22 changed files with 2678 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
REDIS_PORT=7878
REDIS_PASSWORD=fswerfds

View File

@@ -0,0 +1,15 @@
services:
cache:
image: redis:7.4-alpine
restart: always
ports:
- "${REDIS_PORT}:6379" # port_on_public:port_in_docker_container
command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
volumes:
- cache:/data
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD} # Optional, if you will use it in the container
- REDIS_PORT=${REDIS_PORT}
volumes:
cache:
driver: local

34
ResourceHub/Database/run.sh Executable file
View 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

1
ResourceHub/Database/stop.sh Executable file
View File

@@ -0,0 +1 @@
docker-compose down