I'm also looking into this, the approach I have taken thus far is:
Bootstrapping the server:
- Setup the project with
composer --create-project ... --no-dev
into a src
folder (though I still see a lot of dev cruft coming through)
- Setup app, Compile static files, upgrade db etc.
- Set all correct permissions
Which will give me a stock, running store from my src directory (but my webroot is not pointing there)
Then my deployment process:
- Make a new release folder
- rsync the src files into my release (excluding the cruft)
- deploy and unpack my customisations over the top (a handful of theme files, and modules)
- install any third party magento modules through magento connect
- point my hosts webroot to my new release (with a symlink)
- gracefully reload my webserver
This allows me to maintain Magento core code separate from my own, use composer to keep it up to date.. and I don't need to ship 39,102!!! files with each deploy, or run composer commands at deploy time..
...Keen to hear of other approaches or for best practice on this, and id also love to know what files are actually required for production and which are dev.. so I can keep my webroot clean.
Once I'm finished, ill have an ansible playbook and some Fabric commands to orchestrate configuration and deployment, which I'm happy to share.
Hope that helps
composer install
on production? letscodejavascript.com/v3/blog/2014/03/the_npm_debaclecomposer install
. Have you looked into a git hook to automate the process?