Compare commits

...

3 Commits

Author SHA1 Message Date
Kunthawat Greethong
7112a84ab5 Fix: use node 22 for Astro compatibility 2026-04-29 09:28:37 +07:00
Kunthawat Greethong
2b73e75e20 Fix: use pnpm install instead of frozen-lockfile 2026-04-29 08:57:03 +07:00
Kunthawat Greethong
6073575c3b Add Dockerfile for deployment 2026-04-29 08:37:39 +07:00

36
Dockerfile Normal file
View File

@@ -0,0 +1,36 @@
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
FROM deps AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN adduser --system --uid 1001 astro
USER astro
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/public ./public
COPY --from=builder /app/data.db ./data.db
EXPOSE 4321
CMD ["node", "./dist/server/entry.mjs"]