Errors with Dockerfile

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

f8f1d4b6-1530-4b65-a444-67b8c86c5fca


In deployment I get this error

1254872266647277800


And the dockerfile is as follows:


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


brody
EMPLOYEE

a year ago

first off, simplify that dockerfile, no multi layers


I mean I can try but this took me about an hour to construct 🥲


I'll just do all the steps in one directory then


brody
EMPLOYEE

a year ago

and you'll likely come back to it soon enough, but it's too complex for your first try


brody
EMPLOYEE

a year ago

use only a single FROM in the whole dockerfile


alright


the official bun guide was telling me to use multiple to keep things organized so i followed their instructions


Actually, I somehow got everything to work with just a bit of searching around


brody
EMPLOYEE

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


brody
EMPLOYEE

a year ago

what was the issue?


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


I'm now sitting at a comfortable 108 mb of ram usage, which is good enough for me


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


I just had to change the start command though, so all is good


brody
EMPLOYEE

a year ago

are you gonna also follow buns recommendations on deploying to production?


brody
EMPLOYEE

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


I'm fine with how it is rn. The ram usage has decreased a lot


brody
EMPLOYEE

a year ago

sounds good!


Loading...