One small nit: always use exec for the last command in your entrypoint script (exec npm run build) such that the npm process will receive signals (such as SIGTERM to stop the container) rather than the script. Without it, the shell will receive the signals and ignore them (that's how it works when it's PID 1), do after a timeout the Docker daemon will force-kill (SIGKILL) it.
Now if you fetch data from an external data source, how about using incremental static generation? That way, IIUC, you could build the site upfront without the need for that data (but then pay the cost of generation on first access to a page 🤷♂️)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
One small nit: always use
execfor the last command in your entrypoint script (exec npm run build) such that thenpmprocess will receive signals (such asSIGTERMto stop the container) rather than the script. Without it, the shell will receive the signals and ignore them (that's how it works when it's PID 1), do after a timeout the Docker daemon will force-kill (SIGKILL) it.Now if you fetch data from an external data source, how about using incremental static generation? That way, IIUC, you could build the site upfront without the need for that data (but then pay the cost of generation on first access to a page 🤷♂️)