Switch pnpm->npm to fix esbuild build-script approval (matches astroreal)
- pnpm 11 (brew/corepack) errors 'ERR_PNPM_IGNORED_BUILDS: esbuild ignored' even with onlyBuiltDependencies; npm ci handles esbuild cleanly - Moreminimore-astroreal uses npm ci + npm run build (proven on EasyPanel) - Add esbuild as direct dep, generate package-lock.json, remove pnpm files - Dockerfile: npm ci -> npm run build -> node server.js (port 4321) - Verified: npm ci + npm run build produce dist (40 pages) successfully
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -1,8 +1,8 @@
|
||||
# ── มิตซูชัยพร — Astro + Express (static) ─────────────────────────
|
||||
# Build: pnpm build (astro) → Runtime: node server.js (port 4321)
|
||||
# Build: npm run build (astro) → Runtime: node server.js (port 4321)
|
||||
#
|
||||
# Mirrors moreminimore-astroreal deployment pattern that works on EasyPanel:
|
||||
# serve the static Astro build from a small Node/Express server (no nginx).
|
||||
# Uses npm (like moreminimore-astroreal which deploys on EasyPanel).
|
||||
# esbuild builds cleanly with npm ci (no pnpm build-script approval issues).
|
||||
#
|
||||
# Env: PORT (default 4321), GA_ID, FORM_EMAIL, GMAP_LAT/LNG (see .env.example)
|
||||
|
||||
@@ -10,16 +10,15 @@ FROM node:22-bookworm-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# ── Dependencies (pnpm 11 to match lockfile) ─────────────────────
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN corepack enable && corepack prepare pnpm@11 --activate \
|
||||
&& pnpm install --frozen-lockfile
|
||||
# ── Dependencies ──────────────────────────────────────────────────
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
# ── Source + Build ───────────────────────────────────────────────
|
||||
COPY astro.config.mjs tsconfig.json ./
|
||||
COPY src/ src/
|
||||
COPY public/ public/
|
||||
RUN pnpm build
|
||||
RUN npm run build
|
||||
|
||||
# ── Runtime ──────────────────────────────────────────────────────
|
||||
COPY server.js ./
|
||||
|
||||
Reference in New Issue
Block a user