MySQL (Bitnami)

Launch a hardened, non-root MySQL container with near-zero vulnerabilities. Easily configure users, databases, and replication clusters using environment variables.

Deploy a fast, reliable, and secure MySQL database with this production-ready container image. Maintained by Bitnami, this image is hardened, scanned for vulnerabilities, and configured to run as a non-root user, providing an extra layer of security for your applications. It simplifies database management, whether you're running a single instance or a complex cluster.

Getting started is straightforward. You can easily manage your database setup using environment variables. Key capabilities include:

  • Initial Setup: Automatically create a root password, a new database, and a dedicated user on the first run.
  • Data Persistence: Ensure your data is safe by mounting a volume to the /bitnami/mysql/data directory.
  • Replication: Configure a master-slave replication cluster with just a few environment variables for high availability and read scaling.
  • Customization: Execute custom .sql or .sh scripts on startup or provide your own my.cnf file to fine-tune the server configuration to your exact needs.

Directory Structure

mysql-bitnami
bitnami-mysql
mysql-data
.env
docker-compose.yml

docker-compose.yml

services:
  mysql:
    image: bitnami/mysql:latest
    container_name: bitnami_mysql
    ports:
      - "3306:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_DATABASE=my_database
      - MYSQL_USER=my_user
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
    volumes:
      - ./mysql-data:/bitnami/mysql
    restart: unless-stopped

.env

MYSQL_ROOT_PASSWORD=your_super_secret_root_password
MYSQL_PASSWORD=your_super_secret_password
Categories:

Share:

Ad
Favicon

 

  
 

Similar to MySQL (Bitnami)

Favicon

 

  
  
Favicon

 

  
  
Favicon