Ahh got it, yeah, different OSes and what not. Already have someone asking how I did it - I’ll post here in case.
One needs Ruby 3.2.x (through
rbenv, so you aren’t at mercy of the OS), Node v16.19.x/npm 8.19.x, and PostgreSQL (probably any version above 11).
- I created a
.ruby-version file, which specified the ruby version which I installed (
- Did a
bundle and all gems build just fine.
- Within PostgreSQL itself, had to setup the database:
CREATE DATABASE discourse;
CREATE USER discourse WITH password 'fA....';
GRANT ALL PRIVILEGES ON DATABASE discourse TO discourse;
GRANT ALL ON SCHEMA public TO discourse;
I was surprised the
database.yml does not take
production vars (this seems very anti-Rails convention). All db settings were in
config/discourse.conf, along with the SMTP values. I filled those in.
Then ran the database migrations:
bundle exec rails db:migrate
All worked fine, and migrations were successful.
config/sidekiq.yml, after the
development section, I added:
- [critical, 2]
- [default, 1]
- Then edit
lib/tasks/assets.rake, around line 151, add:
so it looks like:
uglified, map =
And install the following npm packages:
npm install terser
npm install -g uglify-js@"<3"
Then build the assets:
RAILS_ENV=production bundle exec rake assets:precompile
And voila! Now this should work:
bundle exec sidekiq -e production -C config/sidekiq.yml
bundle exec puma --config config/puma.rb -e production
sidekiq and the
puma web server going.
(way cheaper, and more control, ie. I have Ruby 3.2.2 going already). Most of the time was working around the quirks (like looking for
production values as they were not where they should be). But other than that, was quite quick!