Files
emdash-blog-template/Dockerfile
Kunthawat Greethong fcf4803b29 Set HOST env var so emdash/astro binds to 0.0.0.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 14:43:23 +07:00

36 lines
609 B
Docker

FROM node:22-alpine AS deps
RUN apk add --no-cache python3 make g++
WORKDIR /app
COPY package.json pnpm-lock.yaml* ./
RUN corepack enable && corepack prepare pnpm@9.0.0 --activate
RUN pnpm install
FROM deps AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN pnpm build && pnpm exec emdash init
FROM deps AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV HOST=0.0.0.0
RUN adduser --system --uid 1001 astro
USER astro
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
EXPOSE 4321
CMD ["node", "./dist/server/entry.mjs"]