refactor: serve static frontend with Go APIs
This commit is contained in:
1 parent
763d2f0648
commit
b14b4fced7
101 files changed
+963
-3928
No files matched your search
+6
-18
@@ -22,26 +22,14 @@ ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
RUN npm run build && npm prune --omit=dev
|
||||
RUN npm run build
|
||||
|
||||
FROM node:22-alpine AS runner
|
||||
WORKDIR /app
|
||||
FROM nginxinc/nginx-unprivileged:1.30.4-alpine AS runner
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV PORT=3000
|
||||
ENV ZHINIAN_RUNTIME_DIR=/app/.runtime
|
||||
|
||||
COPY --from=builder /app/package.json /app/package-lock.json ./
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/.next ./.next
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/scripts ./scripts
|
||||
COPY --from=builder /app/database ./database
|
||||
COPY --from=builder /app/next.config.ts ./next.config.ts
|
||||
|
||||
RUN mkdir -p /app/.runtime/data /app/.runtime/uploads /app/.runtime/generated-results
|
||||
COPY deploy/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY --from=builder /app/out /usr/share/nginx/html
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["sh", "-c", "npx next start --hostname 0.0.0.0 --port ${PORT:-3000}"]
|
||||
ENTRYPOINT []
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in new issue
Block a user