> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zenith.hosting/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Start with https://docs.zenith.hosting/content/quickstart.md. Use NO_COLOR=1 for plain CLI output in non-interactive agent sessions. Run without a TTY and supply explicit template and publishing inputs; NO_COLOR does not bypass prompts or authorization.
> For temporary deployments, read https://docs.zenith.hosting/content/up.md. For publishing and review, read https://docs.zenith.hosting/content/publish.md. A preview uploads local files; publishing uses a pinned public GitHub commit.
> Before creating, changing, or approving zenith-compose.yml, read https://docs.zenith.hosting/llms.txt, then read https://docs.zenith.hosting/content/zenith-compose.md and the complete public schema at https://docs.zenith.hosting/content/zenith-compose-reference.md. Generate only documented fields and follow their validation and completion checks.
> Before creating, changing, publishing, or verifying a container image for Zenith, read https://docs.zenith.hosting/content/containerise.md.
> Treat these live Markdown pages as the source of truth instead of relying on memory or a copied Zenith Compose specification.
> Do not push commits, submit an app, merge pull requests, publish container images, or change registry visibility unless the user explicitly authorizes that external action. Do not bypass browser OAuth, GitHub connection, or Developer Agreement acceptance.

# Mount static configuration files

> Mount read-only, non-secret configuration files with inline Compose configs.

Mount a fixed configuration file with Compose `configs`. Use a named volume and [editable configuration files](https://docs.zenith.hosting/content/configuration-files.md) if the app or its owner must change the file.

> [!WARNING]
>
> Keep passwords, tokens, and private keys out of `configs.content`. Use [environment variables and secrets](https://docs.zenith.hosting/content/environment-variables.md) for credentials.

## Declare the file and mount it

This complete example runs Gatus with a status check and persistent SQLite history:

```yaml zenith-compose.yml theme={"theme":{"light":"github-light-default","dark":"vitesse-black"}}
x-zenith:
  catalog:
    name: Gatus
    description: Monitor endpoints and publish a status page.
    authors:
      - TwiN
    tags:
      - monitoring
    source: https://github.com/TwiN/gatus
    license: Apache-2.0
  expose:
    - service: gatus
      port: 8080
      web: true
  storage:
    history:
      volume: gatus_data
      label: Monitor history
      description: SQLite history of endpoint checks.

services:
  gatus:
    image: ghcr.io/twin/gatus:v5.36.0
    environment:
      GATUS_CONFIG_PATH: /config/config.yaml
    configs:
      - source: gatus-config
        target: /config/config.yaml
        mode: 0444
    volumes:
      - gatus_data:/data
    ports:
      - "8080:8080"

configs:
  gatus-config:
    content: |
      storage:
        type: sqlite
        path: /data/data.db
      endpoints:
        - name: cloudflare
          url: https://www.cloudflare.com
          interval: 60s
          conditions:
            - "[STATUS] == 200"

volumes:
  gatus_data:
```

Gatus reads `/config/config.yaml` from a read-only config mount. Its check history stays on the separate `gatus_data` volume. Only services that reference `gatus-config` receive the file.

Use inline `content` for the file contents. File-backed and external config sources are unsupported. See [Compose configs](https://docs.zenith.hosting/content/zenith-compose-reference.md#compose-configs) for supported fields and defaults.

> [!NOTE]
>
> Standard Compose `configs` is a top-level map next to `services`. Use `x-zenith.configs` for files users can edit in Zenith.

## Apply config changes

When Zenith applies an updated config definition, it restarts the services that consume the changed content. It does not update a running process's mounted file in place. Pushing a Git commit does not automatically update an existing deployment.

## Preserve environment references

Zenith does not substitute `x-zenith.env` values into config content. If your app expands environment variables itself, write `$$` to preserve a literal `$` through Compose loading.

For runtime-generated content, keep the app's startup code that creates the file. For writable configuration, use a named volume.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.