-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deployment to Heroku #18
Comments
I was able to get production build working with this setup:
You have to rename start to something else, since it is the default script heroku runs, if no Procfile is found. |
When I add additional packages via yarn (i.e. yarn add semantic-ui-react styled-components), heroku rejects the build:
However, it works locally, both in development and production mode |
@mrtysn We create a bundle on local when you add packages please make sure you add it to devDependencies. When you just add without "--dev" the bundle will depend on the node_modules folder to run it completely. What we are trying to do here is build a single server.js file already transpiled to es5 and all other bundles includes their respective dependencies. I Hope this solves your problem |
Also @mrtysn I tried the free version of Heroku but it shows the following in logs: I think its due to free version and limited memory. I am new to heroku. I just saw it after the issue was raised. Is there a way we can build the application locally and then push the dist folder, hence running node server.js ? |
Unfortunately, heroku is not designed that way. You push your code via version control (e.g. git) and the build scripts are automatically executed, as they are defined in Procfile. If a Procfile is not provided, they execute some default scripts, depending on the detected application type. In case of node.js, the You can define the Procfile as necessary but I don't know what could be done about the limited memory issue since the paid version also do not have much memory. How about demonstrating an example deployment to Amazon's (AWS) EC2 service? If you were to automate such a deployment via scripts, heroku wouldn't be necessary. Using an EC2 machine also means more control on the system, hence it is more preferable. |
My two cents is that a boilerplate should remain independent of too much opinion lest it need to find its niche in an overcrowded field—of which this repo already has with its SEO focus IMO. |
What I'm suggesting here is not a modification to the codebase. A set of instructions in the deployment section of the docs would help first time users of the project to get going. |
@mrtysn Dockerizing the application is already in the plan ( I am almost there with my local setup and docker ) |
Dockerizing seems like a more robust plan than tailoring to each of these platforms one by one. However, since the only difference for any such platform would be a single short script, I wouldn't suggest completely discarding simpler deployment solutions. |
Any deployment instructions to Amazon EC2, Google Cloud & Heroku or Docker? |
Can you include a section for Heroku deployment instructions?
The text was updated successfully, but these errors were encountered: