@sergeant61/mup-docker-deploy
v0.6.0
Published
Fork of mup-docker-deploy: deploy with Dockerfile, health checks, and rollback
Readme
@sergeant61/mup-docker-deploy
Deploy using a custom Dockerfile.
Fork of meteor-up/mup-docker-deploy with deployment health checks and automatic rollback. The upstream package on npm is mup-docker-deploy.
Getting started
Before starting, you should have a Dockerfile in your app's directory.
First, install mup and this plugin with:
npm i -g mup @sergeant61/mup-docker-deployIn mup.js, add the plugin:
module.exports = {
plugins: ['@sergeant61/mup-docker-deploy'],
// ...
};Second, create a config with:
mup initOpen the config, and make the following adjustments:
For each server:
- host - Usually is the IP Address of the server
- server authentication - You can use a password or set pem to the path to a private key. If neither are set, it uses ssh-agent
In the app section:
- name: A unique name, with no spaces
- path: Path to the app, relative to the config.
- type: Set to
docker-imageto let mup know that this plugin will manage the app
Third, setup the server. Mup will install everything needed to run the app. Run:
mup setupFourth, deploy the app. Run
mup deployMup will upload your app, build the docker image, and run it.
Health check and rollback
You can configure a deployment health check with app.healthCheck.
If the health check fails or times out, the plugin will fail deployment
and try to roll back to the previous image tag.
module.exports = {
app: {
// ...
healthCheck: {
path: '/',
expectedStatus: 200,
interval: 1,
timeout: 60,
// Optional. If omitted, env.PORT is used.
port: 3000
}
}
}Defaults:
path:/expectedStatus:200interval:1secondtimeout:60secondsport:app.env.PORT
Notes:
app.healthCheckis preferred.app.docker.healthCheckis also supported for compatibility.- Rollback requires a
:previousimage tag to exist locally on the server.
