Skip to content

feat: add Appwrite 2 template - #1167

Open
duducp wants to merge 13 commits into
Dokploy:canaryfrom
duducp:feat/appwrite-2
Open

duducp wants to merge 13 commits into
Dokploy:canaryfrom
duducp:feat/appwrite-2

Conversation

@duducp

@duducp duducp commented Sep 17, 2026 •

Copy link
Copy Markdown

What is this PR about?

New PR of Appwrite 2 (appwrite-2, Appwrite 2.3.0)

Adds a self-hosted Appwrite 2.3 stack adapted from the official appwrite/appwrite 2.3.0 docker-compose.yml. The bundled Traefik is replaced with Dokploy domains, so the stack is reachable through the Dokploy reverse proxy instead of Appwrite's own.

Note: this is a new blueprint. There is an open PR (#1132) that updates the existing appwrite blueprint to 2.0.0. Happy to consolidate into that one instead if the maintainers prefer not to keep a separate appwrite-2 template.

Services

appwrite, appwrite-console, appwrite-realtime, appwrite-mqtt, appwrite-worker, appwrite-task-*, postgresql, mongodb (replica set), redis, clickhouse, mariadb, openruntimes-executor, orchestrator, appwrite-geo, appwrite-autogravity, appwrite-assistant, appwrite-browser, plus the optional separate/embedding profile services.

Appwrite 2.3 uses PostgreSQL as its primary database (and for the vectors DB), MongoDB as the documents DB, and Redis/ClickHouse for cache/usage. mariadb is started for parity with upstream but is not used by 2.3.

Domains

By default the API and the Console share the main domain, while Sites and Functions get their own subdomains:

  • https://<main_domain>/v1 → API, https://<main_domain>/v1/realtime → Realtime, https://<main_domain>/ → Console
  • https://sites.<main_domain> → Sites, https://functions.<main_domain> → Functions

The Console can be moved to a dedicated host through the console_domain variable (defaults to console.<main_domain>). This is useful to protect the Console with Cloudflare Access without exposing the public API:

  • https://<main_domain>/v1 → API (external clients), https://<main_domain>/v1/realtime → Realtime
  • https://<console_domain>/ → Console, https://<console_domain>/v1 → API, https://<console_domain>/v1/realtime → Realtime

No wildcard is added for the Console host, and the Sites/Functions wildcards are unchanged. The main-domain routes are kept for backwards compatibility.

Notes

  • The compose file as committed previously did not parse: a dangling networks: block had turned gateway/appwrite/runtimes into phantom services and duplicated the appwrite key. That is fixed here.
  • All images are pinned to explicit versions (appwrite/appwrite:2.2.0, appwrite/new:1.1.96-self-hosted, appwrite/postgres:0.1.0, mongo:8.2.5, redis:7.4.7-alpine, clickhouse/clickhouse-server:26.4.3-alpine, openruntimes/executor:0.29.0, ghcr.io/open-runtimes/orchestrator/orchestrator:2.2.0, etc.).
  • restart: unless-stopped added to the always-on services and to the separate-profile workers.
  • depends_on conditions added so appwrite waits for postgresql, redis and appwrite-geo to be healthy.
  • Secrets are generated with the password:32 helper; the MongoDB keyfile and app user are created at first boot via the mounted mongo-init.js / mongo-entrypoint.sh.
  • Function/site preview subdomains: Appwrite serves them on <sub>.<functionsDomain> / <unique>.<sitesDomain>. Dokploy rejects wildcard hosts in template.toml, so HostRegexp Traefik labels are added to the appwrite service (same approach as the existing appwrite blueprint).
  • Dedicated Console domain: console_domain (default console.<main_domain>) feeds _APP_CONSOLE_DOMAIN and _APP_CONSOLE_HOSTNAMES, and adds Dokploy routes for the Console at / plus /v1 and /v1/realtime on that host, so the Console reaches the API on its own origin. No wildcard is used. _APP_CONSOLE_URL (new in 2.3.0) is set to the console domain, so backend-generated links (OAuth callbacks, emails, VCS comments) point at the Console host.
  • _APP_OPTIONS_FORCE_HTTPS=disabled and _APP_ROUTER_AUTO_CERTIFICATES=disabled by default: Dokploy terminates TLS, and forcing HTTPS would break the console/preview URLs when no HTTPS domain is configured yet.
  • _APP_COMPUTE_RUNTIMES_NETWORK=dokploy-network and the executor's docker.sock//tmp mounts follow the same pattern as the existing appwrite blueprint.
  • Appwrite 2.3.0 changes: _APP_CONSOLE_URL_SCHEME replaced by _APP_CONSOLE_URL (removed upstream), new appwrite-mqtt service, _APP_PWNED_PASSWORDS_DSN env, flutter-3.44 sites runtime, console 1.1.159 and autogravity 0.0.11 with MODEL_BACKEND=focalnet, and the upstream MongoDB init fix (#13593). The MQTT mqtts/wss ports (8883/8084) are not exposed through Dokploy domains, which only route HTTP/HTTPS.

Validation

  • Deployed from the PR preview on a self-hosted Dokploy instance and verified working.
  • node build-scripts/generate-meta.js --check passes.
  • npx tsx build-scripts/validate-template.ts --dir blueprints/appwrite-2 and npx tsx build-scripts/validate-docker-compose.ts --file blueprints/appwrite-2/docker-compose.yml pass.
  • docker compose config passes for the default and for the separate/embedding profiles.
  • Services, images, entrypoints, volumes and env keys were diffed against the official 2.3.0 compose and match; depends_on intentionally adds health conditions.

References

Checklist

Before submitting this PR, please make sure that:

Issues related (if applicable)

N/A

Screenshots or Videos

Captura de Tela 2026-09-16 às 20 59 22 Captura de Tela 2026-09-17 às 16 22 12

Add a self-hosted Appwrite 2.2 stack adapted from the official
docker-compose, using Dokploy domains instead of the bundled Traefik.

- Fix the compose file so it parses: drop the dangling networks block that
  duplicated the appwrite service and created phantom gateway/runtimes
  services
- Pin all images to explicit versions (appwrite/appwrite:2.2.0, etc.)
- Add restart: unless-stopped to the always-on services and to the
  separate-profile workers
Appwrite serves function/site previews on <sub>.<functionsDomain> and
<unique>.<sitesDomain>. Dokploy rejects wildcard hosts in template.toml,
so add Traefik HostRegexp labels on the appwrite service, matching the
existing appwrite blueprint.

Also disable _APP_ROUTER_AUTO_CERTIFICATES since Dokploy terminates TLS
and the bundled Appwrite Traefik is not deployed.
…write

Use depends_on conditions so appwrite does not start before its backing
services are healthy. Compose rejects interpolation in depends_on keys,
so postgresql is referenced by its literal service name.
@duducp duducp mentioned this pull request Sep 17, 2026
3 tasks
@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
templates ✅ Ready (View Log) Visit Preview 235acde

Add a console_domain variable (defaults to console.<main_domain>) and
route the Console, API (/v1) and Realtime (/v1/realtime) on that host,
while keeping the existing main-domain routes intact. Point
_APP_CONSOLE_DOMAIN and _APP_CONSOLE_HOSTNAMES at the console host so
the Console can reach the API on its own origin and can be protected
independently (e.g. Cloudflare Access).
openruntimes-executor looks itself up in Docker by matching its hostname
against the container name. Without container_name the generated name is
"<project>-openruntimes-executor-1", so the lookup fails and the executor
crash loops with "Own container not found" (appwrite/appwrite#13016),
leaving site/function deployments stuck in "building".
openruntimes-executor resolves its own container with gethostname()
against Docker's name filter. With hostname "exc1" the filter never
matches "<project>-openruntimes-executor-1", so the executor crash
loops with "Own container not found" (appwrite/appwrite#13016).

Mirror the appwrite blueprint: set hostname to the service name (a
substring of the generated container name) and point _APP_EXECUTOR_HOST
at http://openruntimes-executor/v1. Avoids container_name, which the
compose validator rejects and which is not deployment-unique.
@hajajmaor

Copy link
Copy Markdown

Any updates? Hoping to see that merged

@duducp

duducp commented Sep 22, 2026

Copy link
Copy Markdown
Author

Any updates? Hoping to see that merged

@Siumauricio, can you get help with the review?

- Bump appwrite/appwrite to 2.3.0, console to 1.1.159, autogravity to 0.0.11
- Replace _APP_CONSOLE_URL_SCHEME with _APP_CONSOLE_URL (removed in 2.3.0)
- Add appwrite-mqtt service with MQTT envs (_APP_MQTT_REPLAY_DEPTH, _APP_MQTT_MAX_PACKET_SIZE)
- Add _APP_PWNED_PASSWORDS_DSN (2.3.0 password breach policy)
- Add flutter-3.44 sites runtime (Jaspr SSR) and its executor image
- Adopt upstream MongoDB init fix (#13593): idempotent init on port 27018

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>

This branch was successfully deployed

1 active deployment
Preview — 235acdea Deployed Sep 24, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants