How do I include extra files on a specific step on Railpack?
passos
MODERATOROP

10 months ago

hey, I need some extra files to install dependencies, how can I do that using Railpack? Here is what I tried:

{
  "$schema": "https://schema.railpack.com",
  "steps": {
    "install": {
      "inputs": [{ "local": true, "include": ["apps/docs/content"] }]
    }
  }
}

I'm getting Install inputs must be an image or step input

Solved

29 Replies

passos
MODERATOROP

10 months ago

004e54e7-64a6-467d-960d-379e6d29e925


brody
EMPLOYEE

10 months ago

feels more like an XY problem here, can you provide the error you get without any custom railpack config, then we can go from there


passos
MODERATOROP

10 months ago

the error I get without railpack is an error from my application telling that it can't find a requested file


passos
MODERATOROP

10 months ago

postinstall is a script that runs automatically (by pnpm/npm) when it finishes installing deps


passos
MODERATOROP

10 months ago

I even added some ls to make sure that it's doing that.

1352042467511500800


brody
EMPLOYEE

10 months ago

what service in what env?


passos
MODERATOROP

10 months ago

3b4c9a2d-f743-41e0-934e-fadffbf44c61


brody
EMPLOYEE

10 months ago

i assume this works on nixpacks?


passos
MODERATOROP

10 months ago

yeah the install command works


passos
MODERATOROP

10 months ago

but im guessing that nixpacks includes the entire app code


brody
EMPLOYEE

10 months ago

then i think i should tag in jr to give the advice here


passos
MODERATOROP

10 months ago

railpack does not to improve the stage cache hit and that makes sense IMO


brody
EMPLOYEE

10 months ago

@jr - when you have a moment, could you give a look into this

link for ref:


jr
EMPLOYEE

10 months ago

What does your package.json look like? There is some logic in Railpack to include all the source files if postinstall is detected so ideally you don't have to have any config in this case. Oh it looks like a monorepo?


jr
EMPLOYEE

10 months ago

This should work for you though (note the "…" to indicate that you want to append to the existing install inputs)

{
  "$schema": "https://schema.railpack.com",
  "steps": {
    "install": {
      "inputs": ["...", { "local": true, "include": ["apps/docs/content"] }]
    }
  }
}

passos
MODERATOROP

10 months ago

im using turborepo, maybe it only checks on the package.json at root?


passos
MODERATOROP

10 months ago

the postinstall is at an app


jr
EMPLOYEE

10 months ago

ah yeah that will do it. Railpack can check that. I'll make a note to add that


jr
EMPLOYEE

10 months ago

it looks like you got it working?


passos
MODERATOROP

10 months ago

i'll try that config you sent me


jr
EMPLOYEE

10 months ago

pro tip: if you are debugging a railpack config file, you can expand the "Successfully prepare…" build log to see the full build plan that was generated

1352047354152226800


jr
EMPLOYEE

10 months ago

you can also likely use

{
  "$schema": "https://schema.railpack.com",
  "steps": {
    "install": {
      "commands": [{"src": "apps/docs/content", "dest": "apps/docs/content" }, "..."]
    }
  }
}

jr
EMPLOYEE

10 months ago

or also just add a "postinstall": "echo noop" to the root package.json until it is fixed in railpack


passos
MODERATOROP

10 months ago

thanks now it went through! im getting another error but now thats my code's fault 😭


jr
EMPLOYEE

10 months ago

unfortunatley railpack can't fix that yet :/
but glad the build is working better. if you have any other feedback about the railpack xp or config file please let us know in this thread


passos
MODERATOROP

10 months ago

and btw, maybe the error should be better than "Install inputs must be an image or step input".
I had no idea that I had to include the default inputs


jr
EMPLOYEE

10 months ago

very good point


jr
EMPLOYEE

10 months ago

the config side of things is still a bit up in the air (hence the warning at the top of the build). Trying to balance low level control to optimize image size and build speed, with high level convience


brody
EMPLOYEE

10 months ago

!s


Status changed to Solved brody 10 months ago


Loading...