How to Use it

1. Install

curl -sf https://dl.widemesh.com/install | sh

2. Deploy your first app

Run the following command in any directory with a Dockerfile:

mesh deploy
In matter of seconds you will get a public url you can use in as website or backend API, e.g: https://platrio.widemesh.dev

CLI Documentation

Interactive Shells

Open an interactive shell to the service web:

mesh run web -- /bin/sh

Configuration Variables

Configuration variables are provided to your stack services as Environment Variables at runtime.

The same variables are provided to your Dockerfile via ARG :

ARG RAILS_ENV=production
ARG MESSAGE

Set or override a configuration:

mesh config set MESSAGE="Hello World"

Read value from standard input:

echo "Hello World" | config set --stdin MESSAGE=-

Read value from local file:

mesh config set --file MESSAGE=./message.txt

Importing Config Variables

From a shell variable with the same name:

export MESSAGE='sample env variable message'
mesh config import MESSAGE

From a .env file:

mesh config import --env-file=.env

From a .json stdin:

$ echo '{"MESSAGE": "message in a json file"}' | mesh config import --json-file=-

From a Heroku app in the current directory:

heroku config -j | mesh config import --json-file=-

Show current configurations

mesh config info

Output:

1 configuration variable found in the stack
+---------+-------------+
| NAME    | VALUE       |
+---------+-------------+
| MESSAGE | Hello World |
+---------+-------------+

Unset a configuration

mesh config unset MESSAGE

Logs

You can stream logs happening across all your stacks:

mesh logs

Output:

cache/nginx:stdout 10.42.0.190 - - [01/Aug/2019:15:28:08 +0000] "GET / HTTP/1.1" 200 85417 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Safari/605.1.15" "10.42.0.1"
cache/nginx:stdout 10.42.0.190 - - [01/Aug/2019:15:28:08 +0000] "GET /bootstrap-4.0.0/dist/css/bootstrap.css HTTP/1.1" 200 178224 "https://platrio.widemesh.dev/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Safari/605.1.15" "10.42.0.1"

Use CTRL-C to stop the command.

Scaling

To manually scale your apps you can use:

mesh services update web --instances=2

Where web is the name of a service in the current stack or app.

HTTPS Certificates and Custom Domains

You can upload your custom TLS certificates:

mesh certs upload public.crt ca.crt private.key

Or with a bundle of combined Certificate and CA files:

mesh certs upload bundle.crt private.key

If you don’t have custom certificates for a domain, Widemesh can provision them for you:

mesh certs request app.example.com

In order for the certificate to provision, your app needs to serve in that custom domain:

mesh endpoints add --name app.example.com --domain app.example.com

Follow the instructions to configure your domain registrar.

Working with Datacenters

Datacenters are just a fancy name for provisioned capacity in a cloud account and region of the cloud.

Registering a new datacenters

Using DigitalOcean accounts:

mesh datacenters do create

You can grab an Token by going to your DigitalOcean account and on the left menu go to Manage -> API and click on Generate new Token. Make sure the Write scope is checked as Widemesh requires both Read and Write permissions to function properly.

By default it provisions a s1 size datacenter with 1GB of RAM And 1 vCPU, you can pass --size <size name> to pick a different size:

Here’s the full table of sizes for DigitalOcean:

Size RAM CPU DO Equivalent
s1 1 GB 1 vCPU s-1vcpu-1gb
s2 2 GB 1 vCPU s-1vcpu-2gb
s3 3 GB 1 vCPU s-1vcpu-3gb
s4 4 GB 2 vCPU s-2vcpu-4gb
s8 8 GB 4 vCPU s-4vcpu-8gb
s16 16 GB 6 vCPU s-6vcpu-16gb
s32 32 GB 8 vCPU s-8vcpu-32gb

Example, to provision an initial 8 GB Datacenter you can use:

mesh datacenter do create --size s8
Regions:

By default all datacenter are provisioned in nyc3, you can override this behavior with --region:

US East:

US West:

Canada:

Europe:

Asia:

See status.digitalocean.com for a full list of regions they support.

Listing datacenters

To list the datacenters you have available:

mesh dc list

Switching between clouds

To switch to another cloud or another cloud account you just have to create another datacenter and update your environment to use the new datacenter, its as easy as:

mesh env update --dc <new-datacenter-name>

The process takes about 30 seconds.

Troubleshooting

We’re here to help you troubleshoot any issues you may be finding, just email us and we’ll get you sorted out quickly.