feat: support standalone Docker runtime and internal CMS API

This commit is contained in:
2026-11-03 19:21:59 +08:00
parent 43edc632a5
commit d5c0aa7562
6 changed files with 99 additions and 4 deletions
+23
View File
@@ -0,0 +1,23 @@
# syntax=docker/dockerfile:1
FROM node:24-alpine AS build
WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED=1
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
ARG NEXT_PUBLIC_API_URL=http://localhost:18000
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
RUN node --test tests/*.test.cjs && npm run build
FROM node:24-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production \
NEXT_TELEMETRY_DISABLED=1 \
HOSTNAME=0.0.0.0 \
PORT=3000
COPY --from=build --chown=node:node /app/.next/standalone ./
COPY --from=build --chown=node:node /app/.next/static ./.next/static
COPY --from=build --chown=node:node /app/public ./public
USER node
EXPOSE 3000
CMD ["node", "server.js"]