louim / dockerfile-rails

Provide Rails generators to produce Dockerfiles and related files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overview

Provides Rails generators to produce Dockerfiles and related files. This is being proposed as the generator to be included in Rails 7.1, and a substantial number of pull requests along those lines have already been merged. This repository contains fixes and features beyond those pull requests. Highlights:

  • Supports all Rails supported releases, not just Rails 7.1, and likely works with a number of previous releases.
  • Can be customized using flags on the generate dockerfile command, and rerun to produce a custom tailored dockerfile based on detecting the actual features used by your application.
  • Can produce a docker-compose.yml file for locally testing your configuration before deploying.

Usage

bundle add dockerfile-rails --group development
bin/rails generate dockerfile

General options:

  • --force - overwrite existing files
  • --ci - include test gems in deployed image
  • --platform=s - specify target platform. See FROM for details.
  • --cache - use build caching to speed up builds
  • --parallel - use multi-stage builds to install gems and node modules in parallel
  • --compose - generate a docker-compose.yml file

Dependencies:

Generally the dockerfile generator will be able to determine what dependencies you are actually using. But should you be using DATABASE_URL, for example, at runtime additional support may be needed:

  • --mysql - add mysql libraries
  • --posgresql - add posgresql libraries
  • --redis - add redis libraries
  • --sqlite3 - add sqlite3 libraries

Optimizations:

Links:

About

Provide Rails generators to produce Dockerfiles and related files.

License:MIT License


Languages

Language:Ruby 52.6%Language:HTML 45.2%Language:Shell 2.2%