Sign inSign up

rockitthill/rails6-node18

By rockitthill

Updated about 2 years ago

ruby:2.7.8-slim build image suitable for most Rails 6 apps with node 18 instead of node 14

Image
0

10K+

rockitthill/rails6-node18 repository overview

The Dockerfile and build configuration can be found here:

https://github.com/rockitthill/docker-rails6-node18

This provides the following:

  • A base image based on rockitthill/ruby27multi, which is based on ruby:2.7.8-slim
  • Configuration of an /app WORKDIR. This is the path for the Rails application itself.
  • Installation of the following:
    • build-essential, curl, git, nano
    • python2 (required by some dependencies)
    • libmariadb-dev (for MariaDB/MySQL)
    • imagemagick (for Carrierwave, Paperclip, or ActiveStorage)
    • node 14.x (LTS)
    • yarn 1.22.4
    • libjemalloc2
  • Bundler configuration:
    • Sets bundler global path to /bundle. This can be used as a volume with docker-compose to cache the app's bundle
  • Path configuration:
    • Sets /app/bin first for app-specific bin files
    • Sets the appropriate bundle paths for executables provided by gems
  • Environment configuration:
    • Sets BINDING to 0.0.0.0 (to allow access to the server outside the container)
    • Sets PORT to 3000 (standard rails server port)
    • Sets EDITOR to nano (easier editing of credentials for us non-vim people)
  • Exposes port 3000

It is recommended to use this in conjunction with docker-compose:

version: '3.9'
services:
  app:
    container_name: app
    image: rockitthill/rails6:latest
    command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -b '0.0.0.0'"
    restart: "unless-stopped"
    volumes:
      - bundle-path:/bundle
      - .:/app
      # Optional:
      # - node-modules-path:/app/node_modules
      # Add path to logs
      # Add path(s) to uploads
    ports:
      - "3000:3000"

volumes:
  bundle-path:
  # Optional:
  # node-modules-path:

Tag summary

Content type

Image

Digest

sha256:2097a43c2

Size

253.5 MB

Last updated

about 2 years ago

docker pull rockitthill/rails6-node18