diff --git a/.env.example b/.env.example index 3de6771..f74b416 100644 --- a/.env.example +++ b/.env.example @@ -23,11 +23,11 @@ ADMIN_IDS= # Only the twentyq module needs this. Leave blank to disable that command. GEMINI_API_KEY= -# SOURCE_COMMIT is injected into the container at runtime by Coolify (a -# predefined env var holding the commit SHA); read at startup for the -# deploynotify owner DM. Leave unset for local `docker compose up` — -# deploynotify just stays silent. -# SOURCE_COMMIT= +# SOURCE_COMMIT (commit SHA) is auto-injected into the container at runtime by +# Coolify and read at startup for the deploynotify owner DM — do NOT set it here +# and do NOT declare it in docker-compose (that would clobber Coolify's value +# with an empty string). Local `docker compose up` has none, so deploynotify +# just stays silent. # ====================== Leave UNSET on self-host ================== # These are AWS-only. cmd/server reads secrets directly from the plain env diff --git a/docker-compose.yml b/docker-compose.yml index 5c88dcb..54ece36 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,10 +16,11 @@ services: ADMIN_IDS: ${ADMIN_IDS} # CSV of admin Telegram user ids # --- Optional --- GEMINI_API_KEY: ${GEMINI_API_KEY} # only the twentyq module needs it - # Coolify injects SOURCE_COMMIT (commit SHA) at deploy time; passed to the - # container so deploynotify DMs the owner once per new version. Empty (e.g. - # local `docker compose up` without it) just stays silent. - SOURCE_COMMIT: ${SOURCE_COMMIT:-} + # SOURCE_COMMIT (commit SHA, read at startup for the deploynotify owner DM) + # is auto-injected into the container by Coolify — do NOT declare it here. + # A `SOURCE_COMMIT: ${SOURCE_COMMIT:-}` entry resolves to "" at compose-parse + # time and would clobber Coolify's runtime value. Local `docker compose up` + # has no SOURCE_COMMIT, so deploynotify just stays silent there. # Storage auto-selects mongodb because MONGO_URL is set — no KV_PROVIDER. # The in-process cron scheduler runs by default — no CRON_MODE. # PORT defaults to 8080 (internal health server) — omit unless overriding. diff --git a/docs/deploy-coolify-selfhosted.md b/docs/deploy-coolify-selfhosted.md index f03fc1b..f0df31c 100644 --- a/docs/deploy-coolify-selfhosted.md +++ b/docs/deploy-coolify-selfhosted.md @@ -88,11 +88,12 @@ SSM/AWS lookup that fails with no AWS creds and bricks startup), `KV_PROVIDER`, bot token; a second poller gets HTTP 409, and a second in-process scheduler double-fires crons. Prefer **stop-first redeploys** so two containers never overlap near a cron time. -5. **deploynotify commit SHA:** Coolify injects `SOURCE_COMMIT` (a predefined - runtime env var) into the container, and the compose `environment` forwards - it, so the bot reads it at startup and DMs the owner the "new version" - notice — no manual wiring. Without it, `deploynotify` stays silent (no - crash) — but you lose that notification. +5. **deploynotify commit SHA:** Coolify auto-injects `SOURCE_COMMIT` (a + predefined runtime env var) into the container, and the bot reads it at + startup to DM the owner the "new version" notice — no manual wiring, and do + **not** declare `SOURCE_COMMIT` in compose/env (a `${SOURCE_COMMIT:-}` entry + resolves to `""` at parse time and clobbers Coolify's value). Without it, + `deploynotify` stays silent (no crash) — but you lose that notification. 6. **Health check:** use Coolify's HTTP monitor against `GET /` (returns `text/plain` `miti99bot ok`). Do **not** use a compose `healthcheck` — the distroless image has no shell/curl and `cmd/server` has no `-healthcheck`