Is there a way to install Discourse without the provided scripts?

Hi everyone,

I’m here again to ask for a strange thing :sparkles:

I am still investigating how to install Discourse for my Internal Community. In the past, I asked about How to install Discourse with an external Redis and an external Postgres and To manage everything in A Kubernetes cluster. You can find the details here

Now I have another doubt because I was told that also, I have to create my own container image to use with helm to deploy, and due to that I won’t be able to perform the installation with the official documentation by using the scripts provided in the cloud installation guide. :cold_sweat:

I tried to build my own image using the bootstrap command but I can’t launch the docker image by myself because it looks for the ruby templates and returns an error.

Is it possible to launch the container image without using the scripts provided? I think I need a bit of help because I tried to look at the bash script but It seems a bit too advanced for me. I was hoping that maybe someone else was in a situation like this and maybe could give me some advice.

Thanks again for everything :revolving_hearts:

To give more context and more details:
I used the launcher script with the command bootstrap to create my own image with my configurations.
Then the documentation says you need to run the launcher with the command run to create the container from the image.
Inspecting the code of the script I found that the instruction of docker is this one:

$docker_path run --shm-size=512m $links $attach_on_run $restart_policy "${env[@]}" "${labels[@]}" -h "$hostname" \
        -e DOCKER_HOST_IP="$docker_ip" --name $config -t "${ports[@]}" $volumes $mac_address $user_args \
        $run_image $boot_command

But I am unable to translate all the variables to a command that I could run alone without the script. Or maybe all this path I’m trying is wrong from the beginning but I wanted to try before asking to test I was able to solve this without bothering anyone

When I try to run the docker image by myself the container exits and looking at the logs I can see this:

Already up to date.
INFO -- : Loading --stdin
/pups/lib/pups/config.rb:23:in `initialize': undefined method `[]' for nil:NilClass (NoMethodError)
	from /pups/lib/pups/cli.rb:27:in `new'
	from /pups/lib/pups/cli.rb:27:in `run'
	from /pups/bin/pups:8:in `<main>'

Try running ./launcher start-cmd app

3 Likes

Thanks this was very helpful :sparkling_heart:

Did this command was on the documentation? If so, sorry about asking, I did not saw it.

Thanks a lot for always helping me :sparkles:

2 Likes

Discourse depends on PostgreSQL running in a shared volume; and a lot of other important files are in that shared volume (images, uploaded files, backups, logs, and more).

If you maintain the file system integrity of the /shared volume, according to Discourse configuration standards, then you can start and stop a Discourse Docker image and container application with ease; however, you cannot build the application (to my knowledge) without the Discourse scripts (unless you do a full reverse engineering on the scripts and write you own script based on the perfectly good working and supported scripts) because the scripts are responsible for building a sophisticated EmberJS SPA (client side technology) on top of Ruby on Rails (a server side technology), not to mention managing the configuration of the core application and all plugins. It’s quite a sophisticated application, to be honest.

Yes, you can start a Discourse container or create a Discourse container from a Discourse image without any scripts, if (and only if) you already have built a perfectly good Discourse Docker image which complies with Discourse configuration standards, including the persistent storage requirements for the database, images and uploads, backups, log files, etc. There is a lot of important files required for Discourse in the shared volume; and so you cannot just “take a plain vanilla Discourse Docker image” and spin it up and running without all the required prerequisites mentioned above (and not all was mentioned above!)

Hope this helps.

Thanks for the reply, this is very helpful :slight_smile: I was yesterday reading about why the scripts are needed in this topic and other few.

Thanks again for your deeper explanation, all of this information helps me to understand how to create my own workflow to work with the standards needed :slight_smile:

1 Like

You are most welcome.

It can be very confusing for anyone who is (1) not a Ruby on Rails developer and (2) not an EmberJS developer.

Basically, you are building a dockerized, production Ruby on Rails application (the server side tech) which is the foundation for a world-class EmberJS SPA application (the main user app); and on top of all that, you get a complete open source configuration management system for all source code maintained by a very talented and experienced team of web savvy people, who have been coding in this environment for a long time. On top of that, you can also get professional hosting and custom development all within the Discourse business ecosystem.

How cool is that? :slight_smile:

2 Likes

Just stumbled upon this. Are you saying I can not run the app and the database on physcially different hosts sharing absolutely nothing?

That would be a complete blocker in my case…

No, that is not the case. Running Discourse with a dedicated external database is a supported and documented use case.

4 Likes