Fabian Richter
Fabian Richter
RRailway
Created by Fabian Richter on 9/25/2023 in #✋|help
Define a build order / setting a build delay (build NextJS after Strapi)
Hi! I have set up a project on Railway which works really great. My project uses a postgres database, strapi as my website backend and nextjs as my frontend. The nextjs frontend is communicating with my strapi backend via a graphql API. However, when triggering a build via git push, my services get redeployed all at the same time. The frontend relies on the backend, so when there is no backend, the frontend build will fail. Usually my backend build takes longer, so I have to manually redeploy the frontend. I already thought about a workaround, which is to use a prebuild-script for my frontend, which simply sleeps for a given amount of time (possibly also with a env variable). Is there a better way, or should I go with my idea? Thanks in advance!
15 replies