#!/usr/bin/env ruby # frozen_string_literal: true # we don't want rails overhead when booting the server and behave like the real app server if ["s", "server"].include?(ARGV[0]) require 'json' raise "No options supported, use puma directly" unless ARGV.size == 1 ENV["RAILS_LOG_TO_STDOUT"] ||= "1" ENV["PORT"] ||= "3000" command = JSON.parse(File.read("Dockerfile")[/^CMD (.*)/, 1]) command.shift(2) if defined?(Bundler) # don't 'bundle exec' twice exec *command end APP_PATH = File.expand_path('../config/application', __dir__) require_relative '../config/boot' require 'rails/commands'