- Add server.js: Express serves dist/ + injects env (GA_ID, FORM_EMAIL, GMAP) at runtime - Container port now 4321 (identical to moreminimore-astroreal that deploys on EasyPanel) - Remove nginx.conf + entrypoint.sh (no longer needed); Dockerfile uses node server.js - Verified: pnpm build + node server.js -> all 40 pages serve 200, env injected, 0 leftovers
28 lines
1.2 KiB
Docker
28 lines
1.2 KiB
Docker
# ── มิตซูชัยพร — Astro + Express (static) ─────────────────────────
|
|
# Build: pnpm 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).
|
|
#
|
|
# Env: PORT (default 4321), GA_ID, FORM_EMAIL, GMAP_LAT/LNG (see .env.example)
|
|
|
|
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
|
|
|
|
# ── Source + Build ───────────────────────────────────────────────
|
|
COPY astro.config.mjs tsconfig.json ./
|
|
COPY src/ src/
|
|
COPY public/ public/
|
|
RUN pnpm build
|
|
|
|
# ── Runtime ──────────────────────────────────────────────────────
|
|
COPY server.js ./
|
|
EXPOSE 4321
|
|
CMD ["node", "server.js"]
|