stefangimmillaro / rails-dockerized

Dockerized rails example repo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dockerized Rails 6

Created on Ubuntu 20.04

This is a minimal example for a Dockerized Rails project with the following technologies

  • Ruby 2.7.2
  • Rails 6.0.3.3
  • PostgreSQL 13.0
  • Redis 6.0.8
  • docker-compose 1.27.4
  • Slim-Buster base image

How to

  • Install Docker Compose https://docs.docker.com/compose/install/
  • Clone repo
  • Create a .env from .env.template. Configure .env.docker but keep the DATABASE_HOST as db.
  • Configure database config-docker/init.sql to be consistent with .env
  • $ docker-compose up (-d to begin build in background) This can take a few minutes
  • Once images to come online run $ docker-compose exec web bundle exec rake db:setup db:migrate to initialize your virtual database.
  • Navigate to http://localhost:3000/ and confirm you see Rails version: 6.0.3.3 and Ruby version: ruby 2.7.2p137

Links

These pages were helpful guides on getting setup. Thank you to the respective authors.

About

Dockerized rails example repo

License:MIT License


Languages

Language:Ruby 75.3%Language:HTML 12.8%Language:JavaScript 8.6%Language:CSS 1.6%Language:Dockerfile 1.5%Language:Shell 0.3%