fix(migrator): node:22 + NODE_OPTIONS tsx/esm for ESM bare specifier resolution
Some checks are pending
CI / Type Check (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Unit Tests (push) Waiting to run
Deploy / Build & Push Image (push) Waiting to run
Deploy / Deploy to VPS (push) Blocked by required conditions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-05-13 18:20:33 +01:00
parent d9cc08d7f1
commit daf90b1127

View file

@ -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"]