All Projects → ledermann → Docker Rails

ledermann / Docker Rails

Licence: mit
Dockerize Rails 6 with ActionCable, Webpacker, Stimulus, Elasticsearch, Sidekiq

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Docker Rails

Ansible Rails
Ruby on Rails deployment using Ansible - with Lets Encrypt, Sidekiq, PostgreSQL, nginx & puma
Stars: ✭ 199 (-76.75%)
Mutual labels:  sidekiq, rails, deployment
Api.rss
RSS as RESTful. This service allows you to transform RSS feed into an awesome API.
Stars: ✭ 340 (-60.28%)
Mutual labels:  sidekiq, elasticsearch, rails
Recommendable
👍👎 A recommendation engine using Likes and Dislikes for your Ruby app
Stars: ✭ 1,340 (+56.54%)
Mutual labels:  sidekiq, rails
Activejob Retry
Automatic retries for ActiveJob
Stars: ✭ 138 (-83.88%)
Mutual labels:  sidekiq, rails
Tomo
A friendly CLI for deploying Rails apps ✨
Stars: ✭ 260 (-69.63%)
Mutual labels:  rails, deployment
React Activestorage Provider
A React component that allows easy file upload using ActiveStorage
Stars: ✭ 102 (-88.08%)
Mutual labels:  rails, file-upload
Limestone
Boilerplate Rails 6 SaaS application with Webpack, Stimulus and Docker integration.
Stars: ✭ 191 (-77.69%)
Mutual labels:  sidekiq, rails
Elasticsearch Rails
Elasticsearch integrations for ActiveModel/Record and Ruby on Rails
Stars: ✭ 2,896 (+238.32%)
Mutual labels:  elasticsearch, rails
Elasticsearch
This repository has been archived.
Stars: ✭ 405 (-52.69%)
Mutual labels:  elasticsearch, deployment
Ansible Rails
Ansible: Ruby on Rails Server
Stars: ✭ 317 (-62.97%)
Mutual labels:  rails, deployment
Milog
Milog 是一基于 Ruby on Rails 的个人博客网站
Stars: ✭ 24 (-97.2%)
Mutual labels:  elasticsearch, rails
Rails
Official Ruby on Rails specific tasks for Capistrano
Stars: ✭ 773 (-9.7%)
Mutual labels:  rails, deployment
Activejob Scheduler
A background job scheduler for any queue backend
Stars: ✭ 24 (-97.2%)
Mutual labels:  sidekiq, rails
Human attribute values
Translation of attribute values in rails
Stars: ✭ 7 (-99.18%)
Mutual labels:  rails
Elasticsearch Smalltalk
Elasticsearch for Pharo Smalltalk
Stars: ✭ 9 (-98.95%)
Mutual labels:  elasticsearch
Elasticsearchjsonld
Generate JSON-LD @contexts from ElasticSearch JSON Mappings
Stars: ✭ 7 (-99.18%)
Mutual labels:  elasticsearch
Spring Boot Elasticsearch Lire Docker
Spring-boot+ElasticSearch+LIRE+SwaggerUI RESTful.
Stars: ✭ 7 (-99.18%)
Mutual labels:  elasticsearch
Ui Bibz
Ui Frameworks based on Bootstrap and Ruby on Rails
Stars: ✭ 9 (-98.95%)
Mutual labels:  rails
Wazuh Chef
Wazuh - Chef cookbooks
Stars: ✭ 9 (-98.95%)
Mutual labels:  elasticsearch
Mongoosastic
Index Mongoose models into elasticsearch automatically. Looking for maintainers!
Stars: ✭ 942 (+10.05%)
Mutual labels:  elasticsearch

Docker-Rails

Maintainability

Simple Rails 6.1 application to demonstrate using Docker for production deployment. The application is a very simple kind of CMS (content management system) allowing to manage posts. Beside the boring CRUD functionality it has some non-default features.

This project aims to build a lean Docker image for use in production. Therefore it's based on the official Alpine Ruby image, uses multi-stage building and some optimizations that I described in my blog. This results in an image size of ~80MB.

Features

Why?

This project demonstrates my way of building Rails applications. The techniques used to build the app should not be considered as "best practice", maybe there are better ways to build. Any feedback would be appreciated.

Multi container architecture

There is an example docker-compose.production.yml. The whole stack is divided into multiple different containers:

  • app: Main part. It contains the Rails code to handle web requests (by using the Puma gem). See the Dockerfile for details. The image is based on the Alpine variant of the official Ruby image and uses multi-stage building.
  • worker: Background processing. It contains the same Rails code, but only runs Sidekiq
  • db: PostgreSQL database
  • elasticsearch: Full text search engine
  • redis: In-memory key/value store (used by Sidekiq, ActionCable and for caching)
  • backup: Regularly backups the database as a dump via CRON to an Amazon S3 bucket

Check it out!

To start up the application in your local Docker environment:

git clone https://github.com/ledermann/docker-rails.git
cd docker-rails
docker-compose build
docker-compose up

Wait some minutes while the database will be prepared by fetching articles from Wikipedia. Then, navigate your browser to http://[DOCKER_HOST]:[DOCKER_PORT].

Sign in to the admin account:

Enjoy!

Tests / CI

On every push, the test suite (including RuboCop checks) is performed via GitHub Actions. If successful, a production image is built and pushed to a private GitLab Docker Registry.

Production deployment

The Docker image build includes precompiled assets only (no node_modules and no sources). The spec folder is removed and the Alpine packages for Node and Yarn are not installed.

The stack is ready to host with traefik or nginx proxy and letsencrypt-nginx-proxy-companion.

Demo

A demo installation is set up on https://docker-rails.georg-ledermann.de.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].