Actually, my understanding on how environment variables are propagated to children processes was inaccurate. As was the purpose of the url property in the server.js config.
I finally ended up with the following solution:
- let
server.urlfinally untouched (defaulting to ‘’) - use the
process.env.WEBSITEvariable directly where I need it - modify the
startscript in my package.json with this:ENV_PATH=${ENV_PATH:=./.env} strapi start - set
ENV_PATHtargeting a production environment file (.env.prod) in the app.yaml - set the
WEBSITEvariable in both .env and .env.prod files with appropriate values.
Not sure if that’s the optimal way of doing things, but this is solving the issue and allows me to keep my dev script in package.json unchanged (since it will use .env. by default).