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
start of readme on the proper way to do production deployments #708
Conversation
@pherris I don't have experience with Elatstic Beanstalk. However, the recommendations probably do not apply to Heroku. CC: @dylangrafmyre Reviewed 1 of 1 files at r1. docs/additional-reading/production-deployment.md, line 3 at r1 (raw file):
vendorize? I've never done that or heard of that. Old school npm used to suggest saving all dependencies in git. Those days are long gone. Now we have the Gemfile.lock, npm-shrinkwrap.json and yarn.lock. docs/additional-reading/production-deployment.md, line 5 at r1 (raw file):
I'm pretty sure that my group has never done things this way. docs/additional-reading/production-deployment.md, line 26 at r1 (raw file):
missing newline at end Comments from Reviewable |
@pherris Any comments on my comments? |
Sorry, I missed your orig. comments. Would you mind walking me through your process for releasing to production? The ideal situation in my mind is to have a single file that progresses through all the environments without rerunning any compilation steps. This ensures that nothing changes between test/prod (based on different machine configurations, changes in a dependency etc). Maybe I don't understand the way you guys already do it though. For Elastic Beanstalk, when I run I was able to resolve my original issue by modifying the
to
This type of problem would be addressed by not building on the server(s) I am deploying to, but building beforehand and deploying an already built/tested package. |
@pherris Our production deploys all use Heroku, which is the standard Rails setup with the Node buildpack. React on Rails modifies the asset precompile to do 2 main things before the regular precompile:
|
So, when you start up the server for the first time you are fetching NPM/Gem dependencies and rebuilding the app on each server it's deployed to. I guess this is the rails way but causes problems when the production environment isn't the same as the dev environment. I was able to get around my Elastic Beanstalk issue as described with the client/package.json change - maybe this process doesn't lend itself to a README because it's really different per environment. Although, it may make sense to at least be clear about what is happening. |
@pherris It's very common to create a script that simulates the production environment locally. I do it all the time. The main thing is to use the ENV "production" for both node and Rails, and to run the precompile before testing this. And you have to remember to clear out the /public/assets directory when you're done ( |
You're saying that you simulate production locally, create the assets, then... what? do you zip those files and deploy them? or is the deploy to higher environments still re-doing all that same work? |
You will want your local script to mirror your deployment script.
In my script, I make sure to put in an echo message to remind not to clear
out the /public/assets when done!
|
@pherris Should we close this one? Or are you still working on this one? I'm all for creating a new document for this type of deployment. However, I want to make sure we don't recommend committing either generated files or npm/ruby dependencies. |
@pherris How about we close this one for now? I'll happy to reopen if you get more details. |
@justin808 this'll have to be a document that gets improved overtime but I do know that the
pkgr
approach will work for prod deployments as we are using this approach on another project.This change is