# Is er een voordeel aan een Docker-installatie?

**URL:** <https://meta.discourse.org/t/is-there-an-advantage-to-a-docker-installation/261128>\
**Category:** Self-hosting\
**Tags:** unsupported-install\
**Created:** [10 april 2023 om 00:00 UTC](https://meta.discourse.org/t/is-there-an-advantage-to-a-docker-installation/261128 "2023-04-10T00:00:21Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jagath](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@jagath](https://meta.discourse.org/u/jagath)\
**Post date:** [10 april 2023 om 00:40 UTC](https://meta.discourse.org/t/is-there-an-advantage-to-a-docker-installation/261128/3 "2023-04-10T00:40:10Z")

</div>

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).

1. I created a `.ruby-version` file, which specified the ruby version which I installed (`3.2.2`).
2. Did a `bundle` and all gems build just fine.
3. Within PostgreSQL itself, had to setup the database:

```plaintext
CREATE DATABASE discourse;
CREATE USER discourse WITH password 'fA....';
GRANT ALL PRIVILEGES ON DATABASE discourse TO discourse;
\c 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:

```plaintext
bundle exec rails db:migrate

```

All worked fine, and migrations were successful.

1. In `config/sidekiq.yml`, after the `development` section, I added:

```plaintext
production:
  :concurrency: 2
  :queues:
    - [critical, 2]
    - [default, 1]
    - [low]
    - [ultra_low]

```

1. Then edit `lib/tasks/assets.rake`, around line 151, add:

```plaintext
harmony: true,

```

so it looks like:

```plaintext
  uglified, map =
    Uglifier.new(
      comments: :none,
      harmony: true,
      source_map: {
        filename: File.basename(from),
        output_filename: File.basename(to),
      },
    ).comp

```

And install the following npm packages:

```plaintext
npm install terser
npm install -g uglify-js@"<3"

```

Then build the assets:

```plaintext
RAILS_ENV=production bundle exec rake assets:precompile

```

And voila! Now this should work:

```plaintext
 bundle exec sidekiq -e production -C config/sidekiq.yml
 bundle exec puma --config config/puma.rb -e production

```

This gets `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!

---

_[View the full topic](https://meta.discourse.org/t/is-there-an-advantage-to-a-docker-installation/261128)._
