Skip to content

feat(docker): upgrade runtime to Node 22 and add postgres support#30

Open
baozhoutao wants to merge 1 commit into
mainfrom
claude/gracious-sanderson-1fd9e6
Open

feat(docker): upgrade runtime to Node 22 and add postgres support#30
baozhoutao wants to merge 1 commit into
mainfrom
claude/gracious-sanderson-1fd9e6

Conversation

@baozhoutao

Copy link
Copy Markdown

What

Hardens the docker/ runtime so it boots cleanly against a PostgreSQL business DB.

  • Node 20 → 22 in docker/Dockerfile (builder + runtime base image).
  • Add pg dependency to @objectos/server. pg is an optional peer of @objectstack/driver-sql; without it the SQL datasource can't connect to postgres. Adding it makes OS_BUSINESS_DB_URL=postgres://… work out of the box.
  • Pass three env vars through in docker/docker-compose.yml:
    • OS_SECRET_KEY / OS_AUTH_SECRET — required for NODE_ENV=production boot (LocalCryptoProvider refuses to start without a stable secret).
    • OS_CORS_ORIGIN — lets the deployer configure better-auth trusted origins (avoids Invalid origin on login/register when accessed via a non-default host/port).

Why

Verified locally: container boots healthy on Node 22 against a PostgreSQL DB, system tables + app tables provision correctly, Console login/register works once OS_CORS_ORIGIN matches the access URL.

Notes

Local-only network workarounds (Alpine mirror swap, corepack-bypass command override) were intentionally kept out of this PR.

- Bump Dockerfile NODE_VERSION 20 -> 22
- Add pg driver dependency to @objectos/server so the postgres
  datasource works out of the box (pg is an optional peer of
  @objectstack/driver-sql)
- Pass OS_SECRET_KEY / OS_AUTH_SECRET / OS_CORS_ORIGIN through in
  docker-compose so production boots (LocalCryptoProvider requires a
  stable secret) and CSRF trusted origins can be configured
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.

1 participant