Revert to SSR mode with Node adapter - keep consent logs backend

This commit is contained in:
Kunthawat
2026-04-02 09:54:07 +07:00
parent df2b00a914
commit e1d170252b
4 changed files with 34 additions and 8 deletions

View File

@@ -1,24 +1,22 @@
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
RUN npm install
COPY . .
RUN mkdir -p ./data && ASTRO_DB_REMOTE_URL=file:./data/consent.db npx astro build --remote
RUN npm run build
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/data ./data
RUN apk add --no-cache sqlite-libs
EXPOSE 80
EXPOSE 4321
ENV NODE_ENV=production
ENV ASTRO_DB_REMOTE_URL=file:/app/data/consent.db
ENV HOST=0.0.0.0
ENV PORT=80
ENV PORT=4321
CMD ["node", "dist/server/entry.mjs"]