Skip to content

A simple docker-compose stack for Sinatra and MySQL development.

Notifications You must be signed in to change notification settings

bcapdevilac/docker.sinatra-ruby-mysql

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Ruby Sinatra MySQL Env

An skeleton for Sinatra applications using MySQL. Includes a Docker stack for running it.

Usage

After cloning the repo, you may want to customize the database name and password at docker-compose.yml.

To build the docker containers, run make build. If there are any .sql files in the ./db folder, they will be run on the database, in alphabetical order. You may use that to create tables or load sample data.

Afterwards, run the stack with make run. The Sinatra app will be available at http://localhost:3000 , and will auto-reload via the Shotgun gem.

While the stack is running, you can access a MySQL prompt with make mysql.

Stack

DB

Standard mysql:5.5 image.

Ruby

Custom image based on ruby:alpine3.4 . 3.4 is used because I've had some trouble building the mysql2 gem on the most recent Alpine version (3.6).

The image install a few dev packages for Ruby and MySQL, Git, and curl. That's a lot of packages (around 400MB) - you may want to remove a few of them; or just remove them all and add just what you need to build your gems.

The image then runs a bundle install, performs some cleanup, then runs rackup.

About

A simple docker-compose stack for Sinatra and MySQL development.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 95.1%
  • Makefile 4.9%