From 5cf77e435ee95cbc1801540b74739689085f7221 Mon Sep 17 00:00:00 2001 From: Yatish Mehta Date: Thu, 18 Apr 2024 22:18:39 -0700 Subject: [PATCH] Added support for foreman and bin/dev --- Gemfile | 2 ++ Gemfile.lock | 2 ++ Procfile.dev | 2 ++ bin/dev | 11 +++++++++++ 4 files changed, 17 insertions(+) create mode 100644 Procfile.dev create mode 100755 bin/dev diff --git a/Gemfile b/Gemfile index 4905790..d5a2ea7 100644 --- a/Gemfile +++ b/Gemfile @@ -28,3 +28,5 @@ group :development do gem "rubocop-rails", ">= 2.22.0", require: false gem "web-console" end + +gem "foreman", "~> 0.88.1" diff --git a/Gemfile.lock b/Gemfile.lock index 2da12a1..44b01c0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -103,6 +103,7 @@ GEM factory_bot_rails (6.4.3) factory_bot (~> 6.4) railties (>= 5.0.0) + foreman (0.88.1) globalid (1.2.1) activesupport (>= 6.1) i18n (1.14.4) @@ -285,6 +286,7 @@ DEPENDENCIES debug dotenv (>= 3.0) factory_bot_rails + foreman (~> 0.88.1) jbuilder letter_opener pg (~> 1.1) diff --git a/Procfile.dev b/Procfile.dev new file mode 100644 index 0000000..1059ed8 --- /dev/null +++ b/Procfile.dev @@ -0,0 +1,2 @@ +web: env RUBY_DEBUG_OPEN=true bin/rails server +vite: bin/vite dev --clobber diff --git a/bin/dev b/bin/dev new file mode 100755 index 0000000..a4e05fa --- /dev/null +++ b/bin/dev @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +if ! gem list foreman -i --silent; then + echo "Installing foreman..." + gem install foreman +fi + +# Default to port 3000 if not specified +export PORT="${PORT:-3000}" + +exec foreman start -f Procfile.dev "$@"