From b70d2c0ebe91f3feed2401a9a483fdcae6a496fc Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Wed, 4 Jun 2025 00:21:23 -0500 Subject: [PATCH] chore: Improvements for codespace (#11667) - move to vite build instead of dev for codespaces - disable miniprofiler --- Makefile | 8 +++++++- Procfile.tunnel | 4 ++++ config/initializers/rack_profiler.rb | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 Procfile.tunnel diff --git a/Makefile b/Makefile index b7a936dc4..552ebe659 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,12 @@ force_run: rm -f tmp/pids/*.pid overmind start -f Procfile.dev +force_run_tunnel: + lsof -ti:3000 | xargs kill -9 2>/dev/null || true + rm -f ./.overmind.sock + rm -f tmp/pids/*.pid + overmind start -f Procfile.tunnel + debug: overmind connect backend @@ -53,4 +59,4 @@ debug_worker: docker: docker build -t $(APP_NAME) -f ./docker/Dockerfile . -.PHONY: setup db_create db_migrate db_seed db_reset db console server burn docker run force_run debug debug_worker +.PHONY: setup db_create db_migrate db_seed db_reset db console server burn docker run force_run force_run_tunnel debug debug_worker diff --git a/Procfile.tunnel b/Procfile.tunnel new file mode 100644 index 000000000..bf3541dd0 --- /dev/null +++ b/Procfile.tunnel @@ -0,0 +1,4 @@ +backend: DISABLE_MINI_PROFILER=true bin/rails s -p 3000 +# https://github.com/mperham/sidekiq/issues/3090#issuecomment-389748695 +worker: dotenv bundle exec sidekiq -C config/sidekiq.yml +vite: bin/vite build --watch diff --git a/config/initializers/rack_profiler.rb b/config/initializers/rack_profiler.rb index 63b2c8516..db9341270 100644 --- a/config/initializers/rack_profiler.rb +++ b/config/initializers/rack_profiler.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -if Rails.env.development? +if Rails.env.development? && ENV['DISABLE_MINI_PROFILER'].blank? require 'rack-mini-profiler' # initialization is skipped so trigger it