Giter VIP home page Giter VIP logo

dockerize-rails's Introduction

Dockerize Rails

Rails with docker stack, examples with nginx webserver, sidekiq worker, webpacker.

Build diferents images for development and production with optimizations.

Stack

Name Versión
Lang Ruby 2.5.1
Framework Rails 5.2.1
Database Postgres 9.5.9
Cache service Redis *
Background processing Sidekiq 5.2.3

Development mode

In development mode don't use nginx webserver, compile assets with webpack dev server, and use persisted volume for live reload code.

Docker stack

Dockerfile [docker-compose],(https://github.com/MiguelSavignano/dockerize-rails/tree/master/docker-compose.yml)

Start server and all services

docker-compose up

See more development configs

Production mode

In production mode use nginx webserver, compile assets, no live reload code. Configure for works in production and optimized docker image size.

Enviroment variables

RAILS_ENV=production
RAILS_LOG_TO_STDOUT="true"
NODE_ENV=production
REDIS_PROVIDER=REDISGREEN_URL

REDISGREEN_URL
RAILS_MASTER_KEY
DATABASE_HOST
DATABASE_USERNAME
DATABASE_PASSWORD

Docker stack

Docker images, docker-compose.production

Example using docker-compose

Start server and all services

docker-compose -f docker-compose.production.yml up

Example using Kubernetes (minikube)

Kubernetes objects (yaml)

See minikube configuration

dockerize-rails's People

Contributors

miguelsavignano avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.