-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
pm2 start app.js --container #3094
Labels
Comments
It looks amazing 👍 |
beta release
|
inerc
pushed a commit
to inerc/pm2
that referenced
this issue
Feb 11, 2020
inerc
pushed a commit
to inerc/pm2
that referenced
this issue
Feb 11, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wizard to start a Node.js application inside a container and easily deploy a production container to a registry.
Development mode
The development mode allows you to easily run an application inside a container, while restarting the application in case of file changes in the host machine.
Wrapping your app inside a container is as easy as:
It will check if a local Dockerfile is present, if not pm2 will generates a Dockerfile with best practices for developing an application inside a container:
1/ It copies the local package.json and run npm install inside the container
1/ Host sources are exposed to the container via VOLUME
1/ pm2-dev is used to auto restart the application on file changes in the host!
Production / Distribution
The distribution mode package the whole application sources inside a container image, ready to be pushed into your favorite registry.
Switching to distribution mode is simple:
When switching to distribution mode, pm2 will edit the local Dockerfile to add some production stuff:
1/ COPY the whole source folder inside the target container
1/ Replace the CMD from pm2-dev to pm2 in production mode
Trial
This is a v2 of the first spec
The text was updated successfully, but these errors were encountered: