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.comYou 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.
How an app runs
Section titled “How an app runs”- 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/datasurvive redeploys. They do not survive a replacement of the host machine and are deleted with the app.
Create an app
Section titled “Create an app”Needs the write scope (Operator or above), and a connection whose status
is Working.
Console
- Open Apps and choose Create app.
- Pick the Cloud account.
- 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.
- Enter the Container port: the port your app listens on inside the container (default 8080).
- 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
mayadyn apps create --connection oci-jeddah --name hello --port 8080 --region me-jeddah-1 --size smallSizes 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.
Environment variables
Section titled “Environment variables”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:
cat > hello.env <<'EOF'DATABASE_URL=postgres://...LOG_LEVEL=infoEOFmayadyn apps secrets hello --env-file hello.envSaving 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.
Private container registry
Section titled “Private container registry”echo "$REGISTRY_PASSWORD" | mayadyn apps secrets hello \ --registry ghcr.io --registry-user acme --registry-password-stdinThe 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.
Private git repository
Section titled “Private git repository”mayadyn apps secrets hello --git-token-file token.txt --git-host github.comThe 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.
Who can read secrets
Section titled “Who can read secrets”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.
Deploy
Section titled “Deploy”Needs the write scope.
From a container image
Section titled “From a container image”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:
mayadyn apps deploy hello --image ghcr.io/acme/web:1.4 --waitFrom a git repository
Section titled “From a git repository”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:
mayadyn apps deploy hello --git https://github.com/acme/web --ref main --dockerfile Dockerfile --waitRules:
- 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.
Change the port with a deploy
Section titled “Change the port with a deploy”mayadyn apps deploy hello --image … --port 3000 changes the app’s port for
this and later deploys.
How long it takes
Section titled “How long it takes”- 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.
When is a release healthy
Section titled “When is a release healthy”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.
When a deploy fails
Section titled “When a deploy fails”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.”
- Read the logs (below). The error message includes the last lines of the container’s output.
- Usual causes: the container listens on a different port than the app’s
Container port; it crashes at start; it does not answer on
/. - 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. |
Releases and rollback
Section titled “Releases and rollback”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:
mayadyn apps releases hellomayadyn apps rollback hello --release 3 --waitA rollback is a deploy of the earlier release, with the current secrets.
Logs and host health
Section titled “Logs and host health”Console: the app’s Logs section shows the container’s recent output and refreshes itself.
CLI:
mayadyn apps logs hellomayadyn apps get hello # status, release, URL, host state and healthLogs are the last lines of the container’s output (about 100 lines), as last reported by the host.
App statuses
Section titled “App statuses”| 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 app’s address
Section titled “The app’s address”- 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.
Delete an app
Section titled “Delete an 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:
mayadyn apps delete hello --wait