Giter VIP home page Giter VIP logo

docker-heroku-rails's Introduction

Heroku Rails Docker Image

Docker container for Rails based on the Heroku base images.

Tags available

Tag format: <Heroku Buildpack version>-<Ruby version>

We try to stay up-to-date with the new supported Heroku images. If you see any new one on this page feel free to open a PR!

There are a couple of version numbers that we have to have in sync with Heroku. Check the Dockerfile for those versions and the links where the Heroku version is kept. If you see any new version feel free to open a PR!

Motivation

The Heroku base images for ruby got deprecated in favor of a more build-your-own Dockerfile strategy. But I still feel that a base image for Rails serves its purposes. There is no point for each developer to replicate much of the instructions I've used here. The more automation the better amirite?

Usage

The root folder for your Rails project must have a Gemfile and Gemfile.lock file. Then build a Dockerfile for your project with this image as base, and with other project-specific instructions FROM ghrc.io/flecto-io/heroku-rails:20-2.7.4.

Then you can either run it with standard Docker docker run --rm -ti your-project or, more commonly from a Docker Compose based development $ docker-compose up web.

For more details regarding local development with docker read this Heroku article

Post-run script

This container comes with a post-run script that:

  • Checks and install any missing gem.
  • Precompile your assets if you are in production mode (checks $RAILS_ENV value).
  • Run your own run other post-run scripts. Just add them to /app/.profile/ folder.

Subsequent runs will use cached changes. This is useful to avoid you from (1) having to rebuild the images each time there is a change on your Gemfile, (2) from having to run a shell just to deploy pending migrations, and (3) to precompile assets if you want to test production mode.

Changelog

  • 2023/12/29: Change organization to flecto-io
  • 2023/04/10: Remove copy of entire app folder into container. Copy only Gemfile to install bundler.
  • 2021/11/01: Change image ownership to Rnters organization. Upgrade to Heroku 20 build image.

License

MIT (see LICENSE file)

docker-heroku-rails's People

Contributors

jfloff avatar rnters-bot avatar jwo avatar michael-lins avatar

Stargazers

Alexandro Castro avatar Arif Bandali avatar Felipe R. avatar Vorachith Kip avatar Benjamin Fleischer avatar Fly Chang avatar Josh Deeden avatar Cedric Johnson avatar Ryan Gendron avatar Olivier Lambeaux avatar Damiano Giacomello avatar Josh Powell avatar Patrick Morgan avatar Sebastian avatar Josiah Campbell avatar Andrew Palmer avatar Joe Clark avatar Robert Audi avatar  avatar

Watchers

James Cloos avatar Diego Porto avatar  avatar  avatar Alexandro Castro avatar Cedric Johnson avatar Joe Clark avatar

docker-heroku-rails's Issues

Bundle install

Love this idea, but shouldn't the bundle install command be run --without development test ?

ENTRYPOINT is too time consuming.

The init script runs every single time a Heroku instance spins up for containers including this because you used ENTRYPOINT. If the bundle install command takes more than 60 seconds the request fails. Also this is time added to delaying a website response.

In my fork I just put a message in it at the end:

RUN echo "Be sure to 'RUN init.sh' in the container using this one."

Heroku 22?

Hey @jfloff -- is there a reason why you backpeddled on the heroku-22 image?

507ebac

Was there some issue with Rails compatibility?

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.