Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 90 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,52 @@ npm i -g mup mup-docker-deploy
```

Second, create a config with:

```bash
mup init
```

Open the config, and make the following adjustments:
Open the config (`mup.js`), and make the following adjustments:

For each server:
- host - Usually is the IP Address of the server

- host - Usually is the Public 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

Remember to enable this plugin by adding this line

```
plugins: ["mup-docker-deploy"],
```

In the `app` section:

- name: A unique name, with no spaces
- path: Path to the app, relative to the config.
- path: Path to the app, relative to the config. `'./'` will do for a docker image.
- type: Set to `docker-image` to let mup know that this plugin will manage the app

Third, setup the server. Mup will install everything needed to run the app. Run:
## Ports

The nginx reverse proxy will listen on ports 80 and 443 for you, and direct traffic to your docker image, which should use a different port.

To do this, you'll need to do a few things. Let's assume you are going to use port 3000

In the `app` section

```
docker: { imagePort: 3000 },
env: {PORT: 3000}, // This may generate a warning from MUP, you can ignore it.
```

and in your `Dockerfile`, you will need to add a line

```
EXPOSE 3000
```

You may also need to adjust some settings in your docker files to make it listen on port 3000. You should remove anything that attempts to listen on port 443.

Thirdly, setup the server. Mup will install everything needed to run the app. Run:

```bash
mup setup
Expand All @@ -44,3 +73,60 @@ mup deploy
```

Mup will upload your app, build the docker image, and run it.

> TODO: Describe how `type: 'remote-image` works. (This appears to be the incomplete part)

## Sample mup.js file for shared environment

```
module.exports = {
servers: {
one: {
host: "1.2.3.4",
username: "ubuntu",
// authenticate from ssh-agent
},
},
plugins: ["mup-docker-deploy"],
app: {
// TODO: change app name and path
name: "sample",
path: "./",
type: "docker-image",
servers: {
one: {},
},
docker: { imagePort: 3000 },
env: {
// TODO: Change to your app's url
// If you are using ssl, it needs to start with https://
ROOT_URL: "https://my-app.com",
PORT: 3000,
},
},

// (Optional)
// Use the proxy to setup ssl or to route requests to the correct
// app when there are several apps

proxy: {
domains: "my-app.com",

ssl: {
// Enable Let's Encrypt
letsEncryptEmail: "my@email.me",
forceSSL: true,
},
},
};

```

You need to change

- host
- username
- app.name
- app.env.ROOT_URL
- proxy.domains
- proxy.ssl.letsEncrptEmail