Comments (10)
Any deployment instructions to Amazon EC2, Google Cloud & Heroku or Docker?
from react-pwa.
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.
from react-pwa.
I was able to get production build working with this setup:
"heroku-prebuild": "yarn build",
"start": "node dist/server.js",
"start-local": "cross-env NODE_ENV=development nodemon --exec babel-node --watch ./src/server.js --watch ./src/client.js --watch ./src/core --watch ./webpack ./src/server.js",
"lint": "eslint --ignore-path .gitignore src webpack",
"build": "cross-env NODE_ENV=production webpack -p --config ./webpack/prod.client.babel.js && cross-env NODE_ENV=production webpack -p --verbose --config ./webpack/prod.server.babel.js",
"test": "npm run lint && cross-env NODE_ENV=test mocha --require babel-core/register "src/**/*.test.js""
You have to rename start to something else, since it is the default script heroku runs, if no Procfile is found.
from react-pwa.
When I add additional packages via yarn (i.e. yarn add semantic-ui-react styled-components), heroku rejects the build:
Module not found: Error: Can't resolve 'semantic-ui-react' in '/tmp/build_36081507992b01d8e7e6d781af163fcf/src/app/components/header'
However, it works locally, both in development and production mode
from react-pwa.
@mrtysn We create a bundle on local when you add packages please make sure you add it to devDependencies.
yarn add semantic-ui-react --dev
This makes sure that whenever the bundle is created it has the code included in it.
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
from react-pwa.
Also @mrtysn I tried the free version of Heroku but it shows the following in logs:
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 2017-10-19T20:01:45.458827+00:00 heroku[web.1]: Stopping process with SIGKILL
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 ?
from react-pwa.
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 start
script is run.
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.
from react-pwa.
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.
from react-pwa.
@mrtysn Dockerizing the application is already in the plan ( I am almost there with my local setup and docker )
I also know most of the good service providers like amazon ec2, google cloud, heroku
are now supporting docker deploy.
I hope anyone with bit of docker knowledge would be able to deploy it easily and scale it with docker-swarm.
I hope that would be a good solution for your deployment problem as well.
from react-pwa.
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.
from react-pwa.
Related Issues (20)
- Upgrade guide required HOT 5
- not able to start server, installation was successfull HOT 2
- npm start not working HOT 3
- npm start fails on Windows. HOT 3
- build, missing index.html HOT 1
- deployment guide on heroku HOT 1
- 运行报错 HOT 2
- React Confusion HOT 1
- 500 (Internal Server Error) HOT 5
- "npm start" is not working HOT 10
- Issue while npm start HOT 1
- reactpwa.com - host access Error 520 HOT 2
- chokidar.js 'return' outside of function HOT 2
- How To Build APK File For Android & IOS ? HOT 1
- Getting CSS problem on windows 10 OS HOT 1
- There is not sufficient document to start project HOT 3
- npm start on your homepage should be npm run dev
- npm run dev failed to start - Could not find a declaration file for module '@reactpwa/core/start HOT 1
- How can i change the html and body class and add stuff to the head element
- Documentation update. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-pwa.