Skip to content

Contributing a new tool

Jusong Yu edited this page Nov 14, 2022 · 18 revisions

Deployment instructions

This wiki explains how to deploy a new tool on the Materials Cloud dokku platform.

For policies around new tools, see Materials Cloud.

SSH configuration

As part of the contribution form, you have sent us a public SSH key, which will allow you to deploy & inspect your app.
Let's call the key pair id_rsa and id_rsa.pub, and your app myapp.

Add the following to your ~/.ssh/config file:

Host matcloud.xyz materialscloud.io
  Hostname %h
  IdentityFile ~/.ssh/id_rsa

matcloud.xyz is the development platform and materialscloud.io is the production platform.

After this, you should be able to query the version of the dokku platform:

$ ssh -t dokku@matcloud.xyz version
dokku version 0.21.1

Deployment

In the git repository that contains your application, run:

  1. git remote add dev-dokku dokku@matcloud.xyz:myapp
  2. git push dev-dokku

That's it! Read the logs for instructions on how to access your app.

Note: dokku assumes that your container will serve the app on its internal port 5000.
If your app is served on a different port, e.g. 8000, specify the port mapping using:

ssh -t dokku@matcloud.xyz proxy:ports-set myapp http:80:8000 https:443:8000

(set the mapping for both http and https)

dokku cheatsheet

  1. View container logs: ssh -t dokku@matcloud.xyz logs myapp
  2. Enter container: ssh -t dokku@matcloud.xyz enter myapp
  3. Check port mapping of your app: ssh -t dokku@matcloud.xyz proxy:report myapp
  4. Restart the app: ssh -t dokku@matcloud.xyz ps:restart myapp
  5. Set environment variable: ssh -t dokku@matcloud.xyz config:set myapp ENV=prod COMPILE_ASSETS=1

Replace dokku@matcloud.xyz with dokku@materialscloud.io to check the production version of the app.

Clone this wiki locally