Public Repository

Last pushed: 2 years ago
Short Description
Automated MySQL Seeder for dev environments
Full Description

#DbSeeder

##Quick and Dirty Overview

Documentation coming soon...I am still messing with this.

I am testing this with docker-compose. I did not feel right about having my application's container seeding a development database. The idea is to use this image, pass a few params and have it seed your development db for you (assuming you are using the mysql docker image for a dev db).

This image extends the official MySQL docker image. It simply uses the MySQL CLI client to dump a SQL file into a linked image running a copy of the official MySQL image. If dbseeder and your mysql containers are properly linked, dbseeder should be able to read hostname and login information of your mysql container.

DbSeeder will automatically terminate once it believes it has seeded your development database. You must run docker-compose in daemon mode. Ex docker-compose up -d

Please DO NOT use this image for production use. Its purpose is to be a development tool.

Sample docker-compose.yml


db:
    image: mysql
    environment:
     - MYSQL_ROOT_PASSWORD=samplePassword
     - MYSQL_DATABASE=some_db
dbseeder:
    image: mkaczorowski/dbseeder
    environment:
     - SEED_FILE=build.sql  # Location of the seed file inside your repo.
    links:
     - db:mysql # Link to the db container. You MUST use the alias 'mysql'.
    volumes:
     - ./:/seed_source # Yet another required param. 
                       # Mount your repo to /seed_source in the container 
                       # so it may access your sql seed file.
web:
    build: .
    ports:
     - "5000:80"
    links:
        - db:database
    environment:
     - DB_HOST=database
     - DB_DRIVER=pdo_mysql
     - DB_USER=root
     - DB_PASSWD=samplePassword
     - DB_SCHEMA=some_db
    volumes:
     - ./:/app
Docker Pull Command
Owner
mkaczorowski

Comments (0)