diff --git a/Dockerfile b/Dockerfile index b1845247a..ba37722e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -117,17 +117,12 @@ FROM ruby:${RUBY_VERSION}-alpine AS render-production RUN apk add --no-cache git build-base postgresql-dev curl-dev gcompat tzdata vips-dev imagemagick -ENV BUNDLE_CACHE=/tmp/bundle \ - BUNDLE_JOBS=2 \ - PORT=3000 - WORKDIR /rails COPY Gemfile Gemfile.lock .ruby-version ./ -RUN --mount=type=cache,id=gems,target=/tmp/bundle \ - bundle install - -ENV BUNDLE_DEPLOYMENT=1 \ +ENV BUNDLE_CACHE=/tmp/bundle \ + BUNDLE_JOBS=2 \ + BUNDLE_DEPLOYMENT=1 \ BUNDLE_WITHOUT=development \ RAILS_ENV=production \ PORT=8080 diff --git a/Gemfile b/Gemfile index 99b9eaf1c..3defc5c1c 100644 --- a/Gemfile +++ b/Gemfile @@ -67,13 +67,6 @@ group :development do gem "rubocop-rails" gem "rubocop-capybara" gem "rubocop-minitest" - - gem "pgreset" - gem "htmlbeautifier" - - # https://github.com/kirillplatonov/hotwire-livereload - gem "hotwire-livereload", "~> 1.3" - gem "dockerfile-rails", ">= 1.6" end diff --git a/Gemfile.lock b/Gemfile.lock index 7575bd314..b62701457 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -125,11 +125,6 @@ GEM ffi (1.16.3) globalid (1.2.1) activesupport (>= 6.1) - hotwire-livereload (1.3.2) - actioncable (>= 6.0.0) - listen (>= 3.0.0) - railties (>= 6.0.0) - htmlbeautifier (1.4.2) i18n (1.14.4) concurrent-ruby (~> 1.0) image_processing (1.12.2) @@ -146,9 +141,6 @@ GEM json (2.7.1) language_server-protocol (3.17.0.3) lint_roller (1.1.0) - listen (3.9.0) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -190,7 +182,6 @@ GEM ast (~> 2.4.1) racc pg (1.5.6) - pgreset (0.4) prism (0.19.0) pry (0.14.2) coderay (~> 1.1) @@ -245,9 +236,6 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.1.0) - rb-fsevent (0.11.2) - rb-inotify (0.10.1) - ffi (~> 1.0) rdoc (6.6.2) psych (>= 4.0.0) redcarpet (3.6.0) @@ -376,14 +364,11 @@ DEPENDENCIES capybara debug dockerfile-rails (>= 1.6) - hotwire-livereload (~> 1.3) - htmlbeautifier image_processing (~> 1.2) importmap-rails minitest-stub_any_instance name_of_person pg (~> 1.1) - pgreset pry-rails puma (>= 5.0) rails (~> 7.1.3) diff --git a/app/views/application/_head.html.erb b/app/views/application/_head.html.erb index 27c02be7c..7cd36a86e 100644 --- a/app/views/application/_head.html.erb +++ b/app/views/application/_head.html.erb @@ -25,5 +25,4 @@ <%= render 'application/head/favicons' %> <%= render 'application/head/meta_tags' %> <%= content_for :head %> - <%= hotwire_livereload_tags if Rails.env.development? %> \ No newline at end of file diff --git a/config/dockerfile.yml b/config/dockerfile.yml index 9ead9e27b..a8866eb78 100644 --- a/config/dockerfile.yml +++ b/config/dockerfile.yml @@ -10,5 +10,4 @@ options: fly_launch_runtime: rails postgresql: true prepare: false - redis: true yjit: true diff --git a/config/environments/development.rb b/config/environments/development.rb index 60c2651d2..959cf0de5 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -76,7 +76,7 @@ # Raise error when a before_action's only/except options reference missing actions config.action_controller.raise_on_missing_callback_actions = true - config.hotwire_livereload.reload_method = :turbo_stream + config.web_console.permissions = "192.168.0.0/16" - config.hosts << ENV['DEV_HOST'] + config.hosts << ENV['DEV_HOST'] if ENV['DEV_HOST'].present? end diff --git a/docker-compose.yml b/docker-compose.yml index 71c83802c..1b9dd1285 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,6 @@ version: '3.1' services: - redis: - image: redis - healthcheck: - test: ["CMD", "redis-cli","ping"] - postgres: image: postgres:16 restart: always @@ -21,20 +16,18 @@ services: retries: 5 base: &base - depends_on: ["redis", "postgres"] + depends_on: ["postgres"] restart: on-failure:3 tty: true build: context: . target: development environment: - - REDIS_URL=redis://redis/0 - DATABASE_URL=postgres://app:secret@postgres/app_development - - DEV_HOST=${DEV_HOST} + - DEV_HOST=${DEV_HOST:-localhost} # Set if you want to use a different hostname ports: ["3000:3000"] volumes: - .:/rails - - /rails/tmp worker: <<: *base diff --git a/fly.toml b/fly.toml index 331a03908..8d43c92b6 100644 --- a/fly.toml +++ b/fly.toml @@ -15,7 +15,9 @@ console_command = '/rails/bin/rails console' [processes] app = './bin/rails server' - worker = 'bundle exec rake solid_queue:start' + +[env] + RUN_SOLID_QUEUE_IN_PUMA = 'true' [http_service] internal_port = 3000 diff --git a/render.yaml b/render.yaml index 0fc6594fa..3f59dca06 100644 --- a/render.yaml +++ b/render.yaml @@ -31,17 +31,8 @@ services: fromDatabase: name: hostedgpt-postgres property: connectionString - - key: REDIS_URL - fromService: - type: redis - name: hostedgpt-redis - property: connectionString - fromGroup: hostedgpt-secrets - key: RUN_SOLID_QUEUE_IN_PUMA value: true - key: WEB_CONCURRENCY value: 2 # sensible default - - type: redis - plan: free - name: hostedgpt-redis - ipAllowList: [] # no external connections