Skip to content

ddnam99/database-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Database Docker Setup

Guide for setting up and running database using Docker.

Requirements

  • Docker
  • Docker Compose

Steps

  1. Copy environment file
cp env.example .env
  1. Configure environment variables
  • Open .env file
  • Modify environment variables according to your needs
  1. Start database
docker-compose up -d

Verification

To check if the database is running successfully:

docker-compose ps

Stop database

docker-compose down

Generate Secure Passwords

Here are some methods to generate secure passwords:

  1. Using OpenSSL (12 characters):
openssl rand -base64 12
  1. Using /dev/urandom with special characters (16 characters):
< /dev/urandom tr -dc 'A-Za-z0-9!@#$%^&*()_+=' | head -c16
  1. Using /dev/urandom with alphanumeric characters (12 characters):
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 12 ; echo

URL Encode Password

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.

About

Setup database with docker

Topics

Resources

Stars

Watchers

Forks