How to deploy a Discourse forum in Railway through their docker image?

AnonymousTRIAL

2 years ago

Discourse is a forum software that can be deployed via a docker image: https://hub.docker.com/r/discourse/base

I tried using this URL directly in Railway "New > Docker Image" option, but the URL is replaced by https://hub.docker.com//discourse — so I copied their base image folder contents (which includes the Dockerfile): https://github.com/discourse/discoursedocker/tree/master/image/base
To a new repo and added a Postgres and Redis service in the project.

The deployment fails with:

59 | ADD install-nginx /tmp/install-nginx
60 | >>> RUN /tmp/install-nginx
61 |

62 | RUN apt -y install advancecomp jhead jpegoptim libjpeg-turbo-progs optipng

ERROR: failed to solve: process "/bin/sh -c /tmp/install-nginx" did not complete successfully: exit code: 2

Does what I am attempting have any chance of working?

Project ID: eb420912-7d00-4c05-8b5a-85b0415e95f4

2 Replies

2 years ago

in the case of discourse to add its docker image to a service you would input discourse/base:release into the input field when prompt to select an image, for a pre-existing service, you can do this by going into the settings under the source section


AnonymousTRIAL

2 years ago

Thank you @Brody , discourse/base:release did work for the image name, it's deployed!
Would there be a way now to run ./discourse-setup on that image, according to this guide:
https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md#6-edit-discourse-configuration


2 years ago

id say youd want to run that command locally through the railway cli


AnonymousTRIAL

2 years ago

thanks again @Brody , I connected to the project's service through the railway CLI on a local clone of discourse_docker repo and ran:
railway run sudo ./discourse-setup
(sudo was needed)
The result was:

Password:
./discourse-setup: line 149: free: command not found
./discourse-setup: line 180: [: : integer expression expected
./discourse-setup: line 189: [: : integer expression expected
Ports 80 and 443 are free for use
samples/standalone.yml -> containers/app.yml
./discourse-setup: line 149: free: command not found
Found GB of memory and 8 physical CPU cores
./discourse-setup: line 260: [: : integer expression expected
./discourse-setup: line 264: [: : integer expression expected
./discourse-setup: line 268: 256 * : syntax error: operand expected (error token is " ")

Hostname for your Discourse? [discourse.example.com]:

I guess there are some issues, but the prompt for generating the yml shows up. I confirmed enough for now, thank you for reaching out!


2 years ago

you would need to have a local install of discourse and all of its cli tools, since railway run runs the command locally but with the railway service variables available


nachocodonerHOBBY

a year ago

Did you manage to install your Discourse forum in Railway service?


samhoquePRO

2 months ago

did anyone figure this out? would love to deploy discourse on railway, else I would need to buy another vps for just discourse..


samhoque

did anyone figure this out? would love to deploy discourse on railway, else I would need to buy another vps for just discourse..

abeshunyahPRO

a month ago

I am researching same but looks like we should choose another hosting.

"discourse does not make self hosting easy for platforms such as Railway" Brody said here: https://station.railway.com/questions/template-for-discourse-9215cc40

Digital Ocean or AWS Lightsail is best options according here: https://meta.discourse.org/t/recommended-hosting-providers-for-self-hosters/79562