How do I include a provider for a pre-deploy command

2 years ago

When I built my project with nixpacks I could add different providers so I added python because my pre-deploy command depends on it, after some complications with my deployment I moved to a Dockerfile and the providers option isn't available anymore in the service settings.

Any guidance on this?

Closed

70 Replies

2 years ago

61e8a6cb-cf14-46b3-b9c7-02bd72e95922


2 years ago

You would need to have your Dockerfile install python


2 years ago

<:salute:1137099685417451530>


2 years ago

It's a multi-stage build, does it matter where I install python?


2 years ago

the final stage


2 years ago

1349547921112170578



2 years ago

huh, you are using bun, doesnt bun have native support for sqlite??


2 years ago

the auth package uses better-sqlite


2 years ago

and it isn't even supposed to use sqlite, it is doing weird thingys


2 years ago

oof


2 years ago

If I add the ?family=0 to the ioredis connect it instead of ENOTFOUND throws a TIMEDOUT


2 years ago

it fails to connect to redis in the pre-deploy command


2 years ago

it needs the auth.ts file on the pre-deploy command, I wonder if it copies it over since pre-deploys are ran in an isolated container


2 years ago

what I'm guessing is that it doesn't find the auth.ts -> doesn't know it uses postgres instead of sqlite -> does these weird thingys and fail


2 years ago

pre-deploy commands are ran in their own container, but it is the same container that will be ran for runtime, same variables, same file system, etc


2 years ago

im going back to dockerfile


2 years ago

(I was trying railpack and nixpacks again)


2 years ago

😢

1349559331787640956


2 years ago

lol


2 years ago

do you know if it's possible to include make as an apt package in railpacks?


2 years ago

https://railpack.com/config/file#root-configuration

I tried adding build-essentials and make to buildAptPackages with no success.


2 years ago

do you need make during build or during deploy?


2 years ago

the pre deploy commands needs python because it uses node-gyp to do some things, node gyp invokes the make command


2 years ago

DEPLOY_APT_PACKAGES=make


2 years ago

amazing


2 years ago

gyp ERR! stack Error: not found: make


2 years ago

also tried build-essential


2 years ago

as stated by the logs, the commands build-essential, make and nodejs were installed



2 years ago

ssh and check


2 years ago

the container is dead


2 years ago

sleep infinite


2 years ago

1349572649080066058


2 years ago

sadge


2 years ago

yeah


2 years ago

install it again and see what happens


2 years ago

within ssh


2 years ago

ok


2 years ago

1349573149393686568


2 years ago

update needed?


2 years ago

yep


2 years ago

does railpack not do an update automatically?


2 years ago

according to the build logs, no.


2 years ago

so now you have make installed?


2 years ago

yes


2 years ago

well thats interesting


2 years ago

indeed


2 years ago

well, if u have any other suggestions... dockerfile didn't work, nixpacks didn't work next thing i'm gonna do is throw this project into the trash can


2 years ago

why didnt the dockerfile work?


2 years ago

redis refused to work


2 years ago

ioredis and the normal redis client


2 years ago

tried as a pre deploy command and as a command in the dockerfile before running the app


2 years ago

even with the ?family=0 with ioredis, just extremely weird behavior


2 years ago

is redis in the same env?


2 years ago

yes


2 years ago

i'll try to get some logs one sec


2 years ago

there's no option to download it lol, this is the deployment id 234b321a-96bd-4ee6-b426-906edd0363f9


2 years ago

pg pool connects but redis doesn't

1349576247352496178


2 years ago

it keeps trying for a while then crashes


2 years ago

this is the first command it runs bunx @better-auth/cli generate --y


2 years ago

generates the schemas to apply to the db and redis for session storage


2 years ago

gonna go to sleep, do you think this is worth opening an issue in the railpacks repo?


2 years ago

drop something in <#1347035681305923634> - hopefully something that can reproduce the issue you had with make not being available


2 years ago

one question since im still trying to figure out this issue


2 years ago

the container that the pre-deploy commands run has the same dir structure as the main container?


2 years ago

yes, it is most literally the same image ran


2 years ago

I FIXED IT!

it was an issue with bun, changing the command to npx fixed it


2 years ago

should've tried that sooner, thanks for the (emotional) support @Brody


2 years ago

so running with node fixed it?


Welcome!

Sign in to your Railway account to join the conversation.

Loading...