fix(migrator): node:22 + NODE_OPTIONS tsx/esm for ESM bare specifier resolution
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d9cc08d7f1
commit
daf90b1127
1 changed files with 6 additions and 2 deletions
|
|
@ -1,7 +1,10 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
# Migrator image: node:20 + full source + pnpm for `pnpm payload migrate` and `pnpm payload migrate:create`
|
||||
# Migrator image — runs `payload migrate` / `payload migrate:create`
|
||||
# Requires node:22 for pnpm 11 (node:sqlite).
|
||||
# tsx 4.x ESM loader must be preloaded via NODE_OPTIONS so bare
|
||||
# specifiers (.ts extensions) resolve before any module is imported.
|
||||
|
||||
FROM node:20-alpine AS base
|
||||
FROM node:22-alpine AS base
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
WORKDIR /app
|
||||
|
||||
|
|
@ -10,5 +13,6 @@ RUN pnpm install --frozen-lockfile
|
|||
|
||||
COPY . .
|
||||
|
||||
ENV NODE_OPTIONS="--import tsx/esm"
|
||||
ENTRYPOINT ["pnpm", "payload"]
|
||||
CMD ["migrate"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue