Skip to content

This is a simple docker-compose project to help run local instances of mysql or postgresql databases when developing apps.

License

Notifications You must be signed in to change notification settings

LaneCommunityCollege/localdbs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lanedbs

This is a simple docker-compose project to help run local instances of mysql or postgresql databases when developing apps.

Setup

  • Install docker
  • Install docker-compose
  • Ensure the dbnet network is trusted in your local firewall.
  • Create these dirs:
    • <project_root>/data/mysql
    • <project_root>/data/pgadmin
    • <project_root>/data/postgresql
  • Run docker-compose up -d

Adding Other DB's

You can add more databases, either other versions of MySQL/PostgreSQL, or entirely different databases like Redis or Elasticsearch.

Just add a new server to the docker-compose.yml file.

For example, to set up MySQL 8:

(I have not tested this.)

Add <project_root>/data/mysql directory for the data.

Then add the service like so:

services:
# ... existing services
  mysql8:
    image: mysql:8
    container_name: lanedbs_mysql8
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: password
    volumes:
      - type: bind
        source: ./data/mysql8
        target: /var/lib/mysql
      - type: bind
        source: ./mysql8.custom.cnf
        target: /etc/mysql/conf.d/99-custom.cnf
    ports:
      - 127.0.0.1:43888:3306
    networks:
      - dbnet

About

This is a simple docker-compose project to help run local instances of mysql or postgresql databases when developing apps.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published