Fix admin-ui Docker image: build as single app so server.js is at /app/server.js.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
78300409a7
commit
4e21eb76ae
2 changed files with 15 additions and 17 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
// standalone only needed for Docker; skip on Windows to avoid symlink EPERM
|
||||
// Required for Docker image (Dokploy). Local Windows may skip via unset DOCKER_BUILD.
|
||||
output: process.env.DOCKER_BUILD === "1" ? "standalone" : undefined,
|
||||
async rewrites() {
|
||||
const apiUrl = process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:3000";
|
||||
|
|
|
|||
|
|
@ -1,20 +1,15 @@
|
|||
FROM node:20-alpine AS base
|
||||
RUN corepack enable && corepack prepare pnpm@9.15.4 --activate
|
||||
FROM node:20-alpine AS deps
|
||||
WORKDIR /app
|
||||
COPY apps/admin-ui/package.json apps/admin-ui/package-lock.json* ./
|
||||
RUN npm install --omit=dev=false
|
||||
|
||||
FROM base AS deps
|
||||
COPY package.json pnpm-workspace.yaml ./
|
||||
COPY apps/admin-ui/package.json ./apps/admin-ui/
|
||||
RUN pnpm install --no-frozen-lockfile
|
||||
|
||||
FROM base AS builder
|
||||
FROM node:20-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY --from=deps /app/apps/admin-ui/node_modules ./apps/admin-ui/node_modules
|
||||
COPY apps/admin-ui ./apps/admin-ui
|
||||
COPY apps/admin-ui/ ./
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV DOCKER_BUILD=1
|
||||
WORKDIR /app/apps/admin-ui
|
||||
RUN pnpm build
|
||||
RUN npx next build
|
||||
|
||||
FROM node:20-alpine AS runner
|
||||
WORKDIR /app
|
||||
|
|
@ -22,8 +17,11 @@ ENV NODE_ENV=production
|
|||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
ENV PORT=3000
|
||||
COPY --from=builder /app/apps/admin-ui/.next/standalone ./
|
||||
COPY --from=builder /app/apps/admin-ui/.next/static ./apps/admin-ui/.next/static
|
||||
COPY --from=builder /app/apps/admin-ui/public ./apps/admin-ui/public
|
||||
|
||||
# Next standalone (single-app layout) puts server.js at /app/server.js
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["node", "apps/admin-ui/server.js"]
|
||||
CMD ["node", "server.js"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue