-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Better deployment description #730
Comments
For everybody who is searching to demo deploy: |
I am in the same boat. Could someone explain to me why the server that is bundled isnt production ready and what would constitute a server that is. For example if I were building a docker container to serve this why shouldnt I use the provided server? Is it security, performance, flexibility, limited featureset which is the reason or... |
I think this is mostly a misunderstanding. Maybe there are fixes we have to make specifically for Heroku, but... @deep-c the server is production ready, it just simply does not do anything besides serve up your |
Thanks for the answer @davezuko. I have to say i like this package more and more. Its clean and simple. But the deployment was somehow a let down for a moment. I started again and looked into the code. Deploying to Heroku isnt that hard it seams at first. At all there are two solutions:
Tell Heroku to also push the devDependencies to build the App on the server via Maybe we could add this somehow in a clean way to the Deploy Section and add also your description about the server? |
@DonHansDampf Those are all great suggestions. I will try to condense them down and add them to the README tonight/tomorrow. An additional solution could just be something like:
|
@davezuko That's also a nice solution. The only problem is: Heroku always runs |
Is it possible to deploy the app directly onto a gh-pages branch? I'm not sure why would a custom server be required since we only have static files (index.html, app.js, vendor.js, app.css, favicon.ico...). This would be extremely convenient. |
Hey @yannbertrand ! No there is no need for a custom server if you just want to host the static files in the dist folder. You only need one if you use the koa server for other things besides hosting like serving a rest api. Deploying to gh-pages works like every other deploy to the gh-pages. Simply run |
this is really a "front-end" kit heroku is a paas—the whole idea is to abstract production hardening and deployment... so, just because the included server runs on their platform does not make it "production ready" as @davezuko suggested, you should use this kit to generate highly optimized, static distributables and then use a battle-tested, purpose-built server for assets.. run your api as a separate service. if you are managing your own ops/servers, i recommend openresty (nginx) or h2o (http2)... however i prefer the "serverless" approach using s3 behind a cloudfront distribution to serve statics with something like s3-plugin-webpack to automate deployments |
Closing in favor of a todo task in our chore to improve the readme: #765 |
Hi @DonHansDampf ! I tried the second approach that you defined above for Heroku deployment: `/.../
"start": {
"command": "npm run clean && npm run compile && babel-node bin/server",
"env": {
"NODE_ENV": "production",
"DEBUG": "app:*"
}
},
/.../` However I get Am I missing something? Thanks in advance |
This Pack needs a better description how a production-ready server can get implented. The Pack itself is great and its fun to work with it. But people will stop using it, when they realise they cant deploy it easily to popular server-structures like heroku.
A Beginner will not notice, that after including devDepencies to Heroku and reading the linked issue #571 that he still doesnt have a running webserver and will get an empty page.
Sadly i also didnt get it running after that. I dont know what i have to do to get an simple production ready server or just "test-deploy" to heroku. Even after changing
/server/main.js
so i also uses the "not stable" sever in production:... if (config.env === 'development' || config.env === 'production') { ...
it doesnt work. Since it cant find the the duck-files:And yes, i know that the Pack cant include a production-ready server. But maybe another branch?
The text was updated successfully, but these errors were encountered: