1.0.2 • Published 3 years ago
dockerize-nginx v1.0.2
Feature
- Packaging application as Docker image based on Nginx.
- Generate a .dockerignore file in the root directory.
- Support for Browser Router.
- Support for gzip_static.
Prerequisite
Install
Install with npm:
npm i -D dockerize-nginxGet Started
Add following to npm scripts
{
"scripts": {
"dockerize": "dockerize"
}
}It will copy the contents of the dist/ directory to the /usr/share/nginx/html directory in the image.
Configuration
These arguments are supported on the command line:
| argument | alias | default | description |
|---|---|---|---|
| distDir | o | dist | Output directory of SPA application |
| imageName | t | \${npm_package_name}:\${npm_package_version} | Name and optionally a container tag (format: "name:tag") |
| writeDockerIgnore | w | false | Whether to generate a .dockerignore file in the root directory |