Guide for setting up and running database using Docker.
- Docker
- Docker Compose
- Copy environment file
cp env.example .env
- Configure environment variables
- Open
.env
file - Modify environment variables according to your needs
- Start database
docker-compose up -d
To check if the database is running successfully:
docker-compose ps
docker-compose down
Here are some methods to generate secure passwords:
- Using OpenSSL (12 characters):
openssl rand -base64 12
- Using /dev/urandom with special characters (16 characters):
< /dev/urandom tr -dc 'A-Za-z0-9!@#$%^&*()_+=' | head -c16
- Using /dev/urandom with alphanumeric characters (12 characters):
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 12 ; echo
To encode special characters in passwords for use in connection strings or URLs:
python3 -c "import urllib.parse; print(urllib.parse.quote('your_password_here'))"
Replace 'your_password_here' with your actual password. This is useful when your password contains special characters that need to be URL-encoded.