guypy
NextJS Application Random Crash
Hey 👋
I have a NextJS service running on Railway which suddenly crashed (there were no active users at that time so the app was idle).
After a restart of the service, everything went back to normal.
On the deploy logs I see a SIGTERM signal (see below), I'm not sure though if it's there because of the restart attempts.
1. If the crash wasn't because of the SIGTERM, how can I investigate this more thoroughly?
2. If the crash was because of the SIGTERM - why did that happen, and how can I prevent it or at least make sure Railway automatically restarts the service?
Thanks!
41 replies
Service deployed with environment variables of another environment
I have two environments set up on my project, "production" and "staging".
For each environment I have a set of shared environment variables.
When I deploy my services on "production", they are deployed with the environment variables from "staging".
Looking at the values in the project settings, it looks like they are set up correctly.
Would appreciate any help on that issue, thanks!
8 replies
Deploying NextJS app on an NX Monorepo
Hey! I'm trying to deploy an NX monorepo containing a NodeJS/Express app, and 2 NextJS apps.
I've set up the build commands for each app to be
nx run <APP_NAME>:build:production
, and the start commands to be nx run <APP_NAME>:serve:production
.
The ports on NX apps are set in a configuration file that doesn't support env variables, so I've set a variable PORT
for each of the applications on Railway.
Deploying the NodeJS app is working fine, however, the NextJS apps seem to be started just fine on the expected port (I see a [ ready ] on http://localhost:4200
log message), but when I try to go to the app's URL I get the "Is your app correctly listening on $PORT?" error.
Any ideas how to make this work?
Thanks!5 replies