Is it possible to spin up docker-compose within a Docker container?
tansandoteth
PROOP

2 years ago

I have a service that uses docker-compose to spin up sandboxed jobs to run. However, I noticed Railway doesn't support docker-compose, so I am unsure if I am just running into a wall here by trying to get this to run on Railway

Closed

36 Replies

tansandoteth
PROOP

2 years ago

N/A


2 years ago

its not possible, the containers are not run with the needed privileges


tansandoteth
PROOP

2 years ago

Got it! Any alternative suggestions?


tansandoteth
PROOP

2 years ago

I'm borderline considering re-architecting the app so i can use railway cause i like railway so much


2 years ago

id need to know a lot more about what you are running before even attempting to come up with an alternative


2 years ago

it goes without saying but you will need to re-architect at least something


tansandoteth
PROOP

2 years ago

It's mostly a bash script that runs JS tests that are pulled in from a trusted source, but I wanted it sandboxed in case of anything


2 years ago

let's assume railway did support docker compose, how does docker compose fit into that?


tansandoteth
PROOP

2 years ago

The thin app just spins up docker-compose and then runs the tests within that container. So the thin app will pull jobs then spin up a container for each one.


tansandoteth
PROOP

2 years ago

The thin app is also dockerized for easier deployment


2 years ago

what is actually handing the JavaScript execution?


tansandoteth
PROOP

2 years ago

nodejs


tansandoteth
PROOP

2 years ago

the docker-compose will spin up a nodejs image


2 years ago

oh so just a simple FROM node type thing?


tansandoteth
PROOP

2 years ago

yeh


tansandoteth
PROOP

2 years ago

This to be exact node:14-alpine


2 years ago

that means it's okay for the code to have network access?


tansandoteth
PROOP

2 years ago

Uh... I am not sure since I didn't write the original code, but lets assume its okay


2 years ago

and spinning up a service on railway, feeding it the source code and waiting for output would be too slow I assume?


tansandoteth
PROOP

2 years ago

I dont mind that


tansandoteth
PROOP

2 years ago

Not time sensitive especially at the current scale


2 years ago

you would need to create a new environment, a new service, upload code to it, and then wait for it's deployment logs


tansandoteth
PROOP

2 years ago

For each job?


2 years ago

well I assumed you would want concurrency, but I guess you could keep a bunch around and reuse them, and then scale up if need be


tansandoteth
PROOP

2 years ago

I am assuming this suggestion means this would all be done from the API right?


2 years ago

exactly


2 years ago

wouldn't be too hard, do the things you need to do on the dashboard and then watch the networking tab for the API calls made


2 years ago

though keep in mind we don't make any guarantees that the API is going to be unchanged for the foreseeable future


tansandoteth
PROOP

2 years ago

Okay thanks! I'll take a closer look into the Railway API


2 years ago

awesome!


2 years ago

though I wonder if there are PAAS offerings that will run sandboxed code for you


tansandoteth
PROOP

2 years ago

yeh i wonder too, but truthfully this was just poorly architected


tansandoteth
PROOP

2 years ago

I'm just trying to not make huge changes and get it working


2 years ago

using some kind of paas that will run code for you is likely going to be to plug in than building it out on railway


tansandoteth
PROOP

2 years ago

thanks brody!


2 years ago

no problem!


Welcome!

Sign in to your Railway account to join the conversation.

Loading...