Closed GoelBiju closed 3 years ago
One approach used to resolve the frontend-common not being found when Heroku runs install is by adding a heroku-postbuild
which runs the build on all the workspaces. This is used in conjunction with the multi-procfile
Heroku buildpack. Procfiles have been added to the frontend and frontend-plugin which sets the command to run on the web
process on Heroku (which will serve the build).
We serve the build folder for the frontend, similar to the way we serve for the plugin, instead of starting the frontend. If I start the frontend, the process exceeds the memory allocated. I am not sure why it exceeds the memory now and why it did not before when it runs npm start
by default (unless it was serving the build?).
As a result of serving the build folder, we also need to specify the settings.json
. The settings provided in the public folder needs to be copied over into the build folder when creating the build in Heroku.
We serve the build folder for the frontend, similar to the way we serve for the plugin, instead of starting the frontend. If I start the frontend, the process exceeds the memory allocated. I am not sure why it exceeds the memory now and why it did not before when it runs
npm start
by default (unless it was serving the build?).As a result of serving the build folder, we also need to specify the
settings.json
. The settings provided in the public folder needs to be copied over into the build folder when creating the build in Heroku.
I have added a REACT_APP_SETTINGS
configuration variable in Heroku which will determine which of the settings files to use for production or development, depending on if it finds the config var.
Deploying the application had another issue where the react-router link to the data page would not be recognised as we were serving a build. I have included a serve-build.js
in the frontend to serve the build and redirect all requests to the index.html
. This was indicated by looking through some similar problems.
Description:
At the moment the build is failing due to the frontend package installation not finding the frontend-common library to install.
Acceptance criteria:
settings.json
anddeploy-settings.json
is copied into the build folder for the frontend