Add Dockerfile production and fix the subsequent commands to install app
Steps i did to add production inviroment to docker :
- Add env-sample file (which should be copied to .env and filled in the with the desired enviroment settings)
- That worked but i had also to force --production=false during yarn install at production enviroment,
because yarn forces that in NODE_ENV is at production and some packages from devDependency did not installed (
clean-webpack-plugin
) - Also added a production.js to config
EDIT:
-
do a yarn install with NODE_ENV=development
-
do a build with NODE_ENV=production
-
yarn install with NODE_ENV=production to remove dev deps (from previous install) (Optional)
-
deploy the remaining files
Also created multiple files one common docker compose file and one production and override compose file
Closes #182 (closed)