Best IaC approach
aurelientanguy
PROOP

3 months ago

Hi, since docker-compose is not supported on Railway, what's the best infrastructure as code approach available on Railway?

I know about the railway.json file, but as far as I understand it's more a config as code for each service. My project is a monorepo, with multiple services, and as of today it requires several clicks through the Railway dashboard to spin up an environment.
The current bottleneck for me is not having a way to replicate easily the same environment both locally (my machine) and remotely (on Railway), like I would do with docker-compose.

11 Replies

3 months ago

Hey, Railway has no IaC support as of yet, depending on your use case you could create a template of your project or duplicate your environment through the dashboard.

There's a terraform provider maintained by the community but I've heard that it's not in a good state.


3 months ago

There's a feedback thread where people is asking for it but I kinda agree with Railway at some points, Railway main benefit is their dashboard
https://discord.com/channels/713503345364697088/1468011203648426166


aurelientanguy
PROOP

3 months ago

Best IaC approach


aurelientanguy
PROOP

3 months ago

Hi, just read the thread. I like Railway's canva and how easily it is to build an infra "visually".
But I don't understand how it's incompatible with docker-compose?
Having a predictible way to reproduce the same services across different environments is important, I guess


3 months ago

Railway has basic support for docker-compose though, you can click and drop your config onto Railway and it'll try its best to map it to Railway services


3 months ago

And any reason on why you can't use the duplicate environment feature from Railway?


aurelientanguy
PROOP

3 months ago

Oh, okay, I've read several posts on station.railway.com asking for docker-compose support, and I haven't seen any updates informing us that this support has been added, my bad.


aurelientanguy
PROOP

3 months ago

Well I can't use this on my machine 😅


3 months ago

Yep, it's been awhile since it's supported but again, its a really basic support and not all docker-compose features all supported


aurelientanguy
PROOP

3 months ago

For the moment, my project only includes:

  • a Tanstack Start app

  • an Elysia.js API

  • a basic Redis

  • Postgres as a custom Dockerfile, forked from Railway's postgres-ssl, that adds some extensions

In your opinion: what's the best option available to me, both locally and on Railway, to describe and manage services using code, not a dashboard?


3 months ago

railway dev


Welcome!

Sign in to your Railway account to join the conversation.

Loading...