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.
Solution:Jump to solution
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
14 Replies
Project ID:
f8f1d4b6-1530-4b65-a444-67b8c86c5fca
f8f1d4b6-1530-4b65-a444-67b8c86c5fca
In deployment I get this error
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
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
and you'll likely come back to it soon enough, but it's too complex for your first try
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
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
what was the issue?
Solution
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
are you gonna also follow buns recommendations on deploying to production?
https://bun.sh/docs/bundler/executables#deploying-to-production
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
sounds good!