modernWebDevGenerator
modernWebDevGenerator copied to clipboard
Add Docker support
What support would be needed for docker? would you want to create a docker image that doesnt use yeoman but a dockerfile? I would like to help you with this issue.
Hello @zachjamesgreen
I wanted to include a way to quickly be able to create a Docker image from:
- the dev version (i.e., w/ sourcemaps, etc)
- the production version
I actually implementing something in an older project, but it needs some reviewing and improvements I think. Here's what I had that we could take inspiration from:
- https://github.com/dsebastien/midnightLightV2/blob/master/Dockerfile
- https://github.com/dsebastien/midnightLightV2/blob/master/DockerfileDev
- https://github.com/dsebastien/midnightLightV2/blob/master/runDevOnDocker.sh
- https://github.com/dsebastien/midnightLightV2/blob/master/runOnDocker.sh
- https://github.com/dsebastien/modernWebDevGenerator/blob/master/app/templates/projectFiles/.dockerignore
Some issues there:
- dockerfiles
- we should probably enforce a specific nodejs version to avoid surprises
- the list of globally installed packages in the image could be shorter
- the TypeScript version should be retrieved from tsconfig.json
- the run commands should reuse scripts defined in package.json
- the CMD command should be "npm" "start" rather than "gulp" "serve"
- needs some documentation
- the shell scripts that create the images were made on Windows, that might not necessarily work on *nix / OSX
Any further ideas are welcome :)