I am quite new to Docker and containerization in general. But I do have some experience programming, also with Node.js, Next.js, HTML, etc. However, this is all self-taught in my spare time, so please don’t be too harsh.
My question is the following: I want to build my personal webpage, but never had a server where I could host this stuff. I recently got a Synology NAS and installed the Container Manager (It’s basically a Docker Container Manager).
I started developing my website with Next.js and everything works fine on my PC. I looked up the (very short) documentation for how to containerize the application, and followed the steps here. They use a Dockerfile to set up a Node.js instance, install all the dependencies, build the application and run it afterwords.
My problem is that building the whole application from scratch with Docker Compose takes a long time (>10 mins) on my NAS, but only like 1 min on my PC (understandable, of course).
In my understanding, if I want to update my website, I have to edit the Next.js project and copy the whole project to my NAS so that it can build everything again.
My question is: Can I develop the website on my PC, build it there too and just have Next.js (aka Node.js) run the build output? And do I have to use the “standalone output” described here, or can I just use “next start” (which I would prefer)?
I think I understand the concept of volumes and my best guess is that the solution has to involve volumes, but I’m just not sure how to use them correctly.
TL;DR: Do I have to build a Next.js application on the deployment device, or can I build the application on my PC and just give the container the build files?
Thank you for your patience and understanding. I just couldn’t find information online on this specific use case.