a year ago
I'm trying to go back to compiled typescript code to reduce bun's memory usage. I've constructed my dockerfile and everything works fine up until the point it has to actually run the code. Could someone that has knowledge on docker assist me, as I'm a complete idiot in this.
23 Replies
a year ago
f8f1d4b6-1530-4b65-a444-67b8c86c5fca
a year ago
In deployment I get this error

a year ago
And the dockerfile is as follows:
a year ago
Just for a bit of context, the reason I have to use my own dockerfile is because of a previous issue with prisma and openssl, which wouldn't load the required engines
a year ago
first off, simplify that dockerfile, no multi layers
a year ago
I mean I can try but this took me about an hour to construct 🥲
a year ago
I'll just do all the steps in one directory then
a year ago
and you'll likely come back to it soon enough, but it's too complex for your first try
a year ago
use only a single FROM in the whole dockerfile
a year ago
alright
a year ago
the official bun guide was telling me to use multiple to keep things organized so i followed their instructions
a year ago
Actually, I somehow got everything to work with just a bit of searching around
a year ago
and that's absolutely the way you want to do things, but it's just a little more complex, so its best to start off simple first
a year ago
what was the issue?
a year ago
I wasn't copying the files properly from directory to directory, that's what I understood. A friend also helped simplify the file to only 2 stages and gave me a little guidance on how docker and it's image system works
a year ago
I'm now sitting at a comfortable 108 mb of ram usage, which is good enough for me
a year ago
Tho I had to bring my old deploy.js script back to life since the built in one (in client functions) broke due to the image setup
a year ago
I just had to change the start command though, so all is good
a year ago
are you gonna also follow buns recommendations on deploying to production?
a year ago
a year ago
I tried, but the exe crashes since there's 3rd party things that I use which bun can't compile to an exe
a year ago
I'm fine with how it is rn. The ram usage has decreased a lot
a year ago
sounds good!