Custom start command env troubleshooting

Currently I have the following as my start command for a Next.js app:
/bin/sh -c "export NEXT_PUBLIC_ASSET_PREFIX=$(cat ASSET_PREFIX) && node server.js"

ASSET_PREFIX is a file with the content being the public URL for CDN assets
sshing into the service and cat ASSET_PREFIX works fine

The problem is, NEXT_PUBLIC_ASSET_PREFIX doesn't appear to get set

Solved$10 Bounty

3 Replies

Can't do a variable from Railway because the URL written to ASSET_PREFIX depends on RAILWAY_GIT_COMMIT_SHA which cannot be referenced from the UI (will just be blank)


oh wait NEXT_PUBLIC_ is done at build time


might be the problem hihi


Status changed to Solved brody about 2 months ago


Loading...