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:
2026-08-06 15:27:44 +07:00
parent 44c405730e
commit c497d8b2f1
5 changed files with 5169 additions and 3222 deletions

View File

@@ -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 ./

5160
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -15,6 +15,7 @@
},
"dependencies": {
"astro": "^7.1.6",
"express": "^5.2.1"
"express": "^5.2.1",
"esbuild": "0.28.1"
}
}

3210
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +0,0 @@
allowBuilds:
esbuild: true
sharp: true