Custom Domains and Managing a Stack

ជំពូកនេះមិនទាន់ត្រូវបានបកប្រែជាភាសាខ្មែរនៅឡើយទេ — សូមអានជាភាសាអង់គ្លេសខាងក្រោម។

Table of Contents

  1. Add a domain while creating a stack
  2. Add a domain to an existing stack
  3. Configure DNS
  4. Checking stack state
  5. Updating and deleting a stack
  6. Beginner Pitfalls

1. Add a domain while creating a stack

  1. Click Create Stack.
  2. Provide the stack information (see Part 1), add your domain, then click Create & Deploy. This deploys your application directly.

2. Add a domain to an existing stack

  1. Click the ellipsis (three dots) menu on your stack.
  2. From the dropdown, click Edit.
  3. Add your domain, then click Update or Pull & Update. This deploys your application directly.
  4. Click on the stack to view its details.
    • Make sure the state is Running — the CNAME only works correctly once the stack is running.
  5. Locate the Domain Name and CNAME value on the stack details page, and copy the CNAME.

3. Configure DNS

Add a CNAME record with your DNS provider (e.g. Cloudflare):

SettingValue
TypeCNAME
Name@ for the root domain, or your subdomain (e.g. www)
TargetThe CNAME value from mysabay.com (e.g. abc123.sabay.com)
Proxy statusDNS only (turn off the proxy / grey cloud in Cloudflare)

After saving, the new CNAME record should appear in your DNS provider's management table.

Wait for DNS propagation — usually 5–30 minutes, though it can take up to 24 hours to fully propagate globally.

4. Checking stack state

Open a stack to view its details. Its state must be Running for features like the domain/CNAME to work correctly — if DNS or your app isn't behaving as expected, check this first.

Each service's own Service Info tab (in the deployed stack view) shows:

  • Container Image, Restart Policy, and Resource — read-only mirrors of what was set when creating/editing the service.
  • Host Name — the domain you assigned this service.
  • Domain Generate — an auto-assigned *.sabay.com subdomain for this service.
  • Service Network — an internal Docker network name for this service, formatted uid-<account-uid>-cca-<stack-name>_<service-name> (e.g. uid-39789111-cca-run-app-hello_ui). Other services in the same stack can reach this one directly over this internal network at http://<service-network-value>:<container-port>, without going through a public domain — see Part 4 for how multi-service-stack uses this.

Start/Stop/Restart controls for the service are also available from this view.

5. Updating and deleting a stack

Update:

  1. Click the ellipsis (three dots) menu on your stack.
  2. Click Edit, change whatever fields you need (including domain).
  3. Click Update or Pull & Update to redeploy with your changes.

Delete:

  1. Click the ellipsis (meatballs menu) on the stack you want to remove, then click Remove.
  2. A confirmation pop-up will ask you to confirm the deletion.
  3. Once confirmed, the stack processes deletion; completion is shown via a pop-up in the corner of the screen.

6. Beginner Pitfalls

  • Checking DNS before the stack is Running. The CNAME target only resolves correctly once the stack's state shows Running — check that first if a custom domain doesn't seem to work.
  • Expecting DNS changes instantly. Propagation is usually 5–30 minutes but can take up to 24 hours — don't assume a misconfiguration just because it hasn't resolved yet.
  • Leaving the CDN proxy on for the CNAME record. In Cloudflare specifically, the record needs "DNS only" (grey cloud), not the orange-cloud proxy.
  • Confusing "Domain Generate" with "Host Name". "Domain Generate" is an auto-assigned *.sabay.com subdomain Run App gives you regardless; "Host Name" is the custom domain you explicitly assigned.

ទិញកាហ្វេជូនខ្ញុំ

ចូលចិត្តមេរៀននេះមែនទេ? សូមពិចារណាទិញកាហ្វេជូនខ្ញុំមួយកែវ ដើម្បីគាំទ្រការបង្កើតមាតិកាឥតគិតថ្លៃបន្ថែមទៀត!