Skip to content

Apps

An app is a container that runs on its own machine in one of your cloud accounts, served over HTTPS at:

https://<app>.<workspace>.apps.mayadyn.com

You deploy it from a container image or from a git repository with a Dockerfile. Each deploy is a numbered release; a release that fails leaves the previous one serving.

  • One machine per app. The first deploy creates a host machine in your account (Ubuntu 24.04, the app’s size, default small). Only ports 80 and 443 are open to it.
  • HTTPS is automatic. Mayadyn issues one certificate per workspace, *.<workspace>.apps.mayadyn.com, shared by the workspace’s apps. Your app names do not appear in public certificate logs; your workspace ID does. Certificates are renewed automatically.
  • The host pulls its work. A small Mayadyn agent on the host asks Mayadyn what to run and reports back at least every 30 seconds. There is no inbound control port.
  • The container is sandboxed. It runs without extra privileges, with a process limit and a memory limit (a quarter of the machine’s memory, at least 512 MB, is left for the system). It cannot reach the cloud’s metadata service.
  • Your data lives in /data. Files the container writes under /data survive redeploys. They do not survive a replacement of the host machine and are deleted with the app.

Needs the write scope (Operator or above), and a connection whose status is Working.

Console

  1. Open Apps and choose Create app.
  2. Pick the Cloud account.
  3. Enter the App name. It becomes part of the link: lowercase letters, digits and dashes, starting with a letter, at most 40 characters. Names are unique in a workspace.
  4. Enter the Container port: the port your app listens on inside the container (default 8080).
  5. Choose Create app. Nothing runs yet.

The console creates the app in the connection’s default region with the small size. To choose the region or size, use the CLI or API.

CLI

Terminal window
mayadyn apps create --connection oci-jeddah --name hello --port 8080 --region me-jeddah-1 --size small

Sizes are the machine sizes xsmall, small, medium, large (see Virtual machines).

Set environment variables and private registry or git access

Section titled “Set environment variables and private registry or git access”

App secrets are write-only: once saved, they are never shown again, by any screen or API. They are stored encrypted and delivered only to the app’s own host. They apply on the next deploy.

Console: open the app (Deploy on its row), and under Environment variables enter one KEY=VALUE per line, then Save. The console says Saved. Applies on the next deploy.

CLI:

Terminal window
cat > hello.env <<'EOF'
DATABASE_URL=postgres://...
LOG_LEVEL=info
EOF
mayadyn apps secrets hello --env-file hello.env

Saving environment variables replaces the whole set. Lines starting with # and empty lines are ignored.

Rules:

  • Up to 200 variables, 64 KB in total.
  • Names: letters, digits and _, not starting with a digit, up to 128 characters.
  • Values cannot contain line breaks.
Terminal window
echo "$REGISTRY_PASSWORD" | mayadyn apps secrets hello \
--registry ghcr.io --registry-user acme --registry-password-stdin

The server is a host name with an optional port. Server, user and password are all required. The console has no field for this; use the CLI or the API.

Terminal window
mayadyn apps secrets hello --git-token-file token.txt --git-host github.com

The token is sent only to the host you name in --git-host, never to any other, even if a later deploy points at another host.

Registry credentials and the git token are kept when you later save only environment variables; give new ones to replace them.

Secrets are not readable through Mayadyn. But anyone who can deploy (the write scope) can deploy code that prints them, and anyone who can read the app (read) can read its logs. Do not log secrets in your app.

Needs the write scope.

Console: open the app, pick Container image under Deploy a new release, enter the Image (e.g. ghcr.io/acme/web:1.4), and choose Deploy.

CLI:

Terminal window
mayadyn apps deploy hello --image ghcr.io/acme/web:1.4 --wait

The repository must contain a Dockerfile. The host clones and builds it.

Console: pick Git repository, enter Repository URL (https), Branch or tag and, optionally, Dockerfile path (default Dockerfile), and choose Deploy.

CLI:

Terminal window
mayadyn apps deploy hello --git https://github.com/acme/web --ref main --dockerfile Dockerfile --wait

Rules:

  • The URL must be https:// and must not contain credentials. Put a token in the app’s secrets instead.
  • The ref defaults to main.
  • The Dockerfile path must be inside the repository.

mayadyn apps deploy hello --image … --port 3000 changes the app’s port for this and later deploys.

  • The first deploy creates the host machine and can take up to about 10 minutes (“The first deploy creates the app’s machine and can take a few minutes.”).
  • Later deploys take seconds to a minute or two.

Each deploy is an operation. Only one operation runs on an app at a time; a second gets conflict.

After starting the new container, the host requests GET / on the container port. The release is healthy when it answers with any status below 500 within 3 minutes. Then Mayadyn publishes the app’s address and marks the release Live.

If the new release does not become healthy, it is marked Failed and the previous release keeps serving (or is put back). The operation fails with deploy_failed: “The release failed; the previous one is still running. Check the logs.”

  1. Read the logs (below). The error message includes the last lines of the container’s output.
  2. Usual causes: the container listens on a different port than the app’s Container port; it crashes at start; it does not answer on /.
  3. Fix and deploy again.

Other failures:

Code Meaning
timeout The host did not report the release in time. The host may still be starting; check the logs and deploy again.
connection_unhealthy The app’s cloud connection could not be opened. Check the connection.
quota_exceeded, capacity_unavailable, … The host machine could not be created; the hint says what to do.
provider_error Mayadyn could not update the app’s address. Deploy again.

Console: the app’s Releases list shows each release with its status: Live, Failed, Earlier, Waiting or Deploying. Choose Roll back to this on an Earlier release to deploy it again.

CLI:

Terminal window
mayadyn apps releases hello
mayadyn apps rollback hello --release 3 --wait

A rollback is a deploy of the earlier release, with the current secrets.

Console: the app’s Logs section shows the container’s recent output and refreshes itself.

CLI:

Terminal window
mayadyn apps logs hello
mayadyn apps get hello # status, release, URL, host state and health

Logs are the last lines of the container’s output (about 100 lines), as last reported by the host.

Status Console Meaning
new Not deployed Created, never deployed.
deploying Deploying A deploy is running.
live Live A release is serving.
failed Failed The last deploy failed and no earlier release is serving.
deleting Deleting Being deleted.
  • The address is published once a release is healthy.
  • If the host machine is replaced, the name moves to the new address.
  • If the host stops reporting for 3 minutes (for example it was stopped or deleted in the cloud console), Mayadyn withdraws the name, so it never points at an address your cloud may give to someone else. The host’s next report puts it back.

Do not stop or delete an app’s host machine in your cloud console; manage it through the app.

Deleting removes the app’s address, its host machine (and with it /data), its releases and its secrets. It cannot be undone. Needs the destroy scope (Admin or Owner).

Console: open the app, choose Delete app, and confirm.

CLI:

Terminal window
mayadyn apps delete hello --wait