Seems to me that the following in server.js shouldn't be absolute. This breaks builds being deployed.
Currently process.env.RAZZLE_PUBLIC_DIR resolves to: /some/absolute/path/to/build/public
This causes issues when deploying to cloud services as the build will reference your local environment.
Meaning building the relative path in server.js won't work either.
Yes you can override this in .env.production or perhaps via a custom plugin or something, but it seems to me Razzle should get the relative path and then set RAZZLE_PUBLIC_DIR to something like ./build/public.
Otherwise you'd always have to build on the remote host or something before starting seems counterproductive.
Yeah probably right. This probably has been neglected as our assets are always served via cdn in prod. Open a PR?
I gotcha.
Sure N/P. Just getting feet wet with Razzle here, so comments on where/how this should be implemented?
FYI going to tinker around w/ Razzle for better part of Nov. doing some due diligence, hopefully I can help the project some.
@jaredpalmer give me some direction on this and I'll take care of it.
I feel this somehow relates to our issue. Deploying with docker, we are finding that static assets are returning a 404 because express just can't find the file.
I would open a PR with @blujedis if I understood more, sorry :)
because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Any update on this? Can I help?
I've solved this one with additional variable:
const publicDir = process.env.RAZZLE_PUBLIC_DOCKER_DIR || process.env.RAZZLE_PUBLIC_DIR;
server
.use(express.static(publicDir))
...
Maybe add a forceRuntimeEnvVars option to razzle.config.js?
Made process.env.RAZZLE_PUBLIC_DIR relative in canary.
Most helpful comment
I've solved this one with additional variable: