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} */
|
/** @type {import('next').NextConfig} */
|
||||||
const 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,
|
output: process.env.DOCKER_BUILD === "1" ? "standalone" : undefined,
|
||||||
async rewrites() {
|
async rewrites() {
|
||||||
const apiUrl = process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:3000";
|
const apiUrl = process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:3000";
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,15 @@
|
||||||
FROM node:20-alpine AS base
|
FROM node:20-alpine AS deps
|
||||||
RUN corepack enable && corepack prepare pnpm@9.15.4 --activate
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
COPY apps/admin-ui/package.json apps/admin-ui/package-lock.json* ./
|
||||||
|
RUN npm install --omit=dev=false
|
||||||
|
|
||||||
FROM base AS deps
|
FROM node:20-alpine AS builder
|
||||||
COPY package.json pnpm-workspace.yaml ./
|
WORKDIR /app
|
||||||
COPY apps/admin-ui/package.json ./apps/admin-ui/
|
|
||||||
RUN pnpm install --no-frozen-lockfile
|
|
||||||
|
|
||||||
FROM base AS builder
|
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
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/ ./
|
||||||
COPY apps/admin-ui ./apps/admin-ui
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
ENV DOCKER_BUILD=1
|
ENV DOCKER_BUILD=1
|
||||||
WORKDIR /app/apps/admin-ui
|
RUN npx next build
|
||||||
RUN pnpm build
|
|
||||||
|
|
||||||
FROM node:20-alpine AS runner
|
FROM node:20-alpine AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
@ -22,8 +17,11 @@ ENV NODE_ENV=production
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
ENV HOSTNAME=0.0.0.0
|
ENV HOSTNAME=0.0.0.0
|
||||||
ENV PORT=3000
|
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
|
# Next standalone (single-app layout) puts server.js at /app/server.js
|
||||||
COPY --from=builder /app/apps/admin-ui/public ./apps/admin-ui/public
|
COPY --from=builder /app/public ./public
|
||||||
|
COPY --from=builder /app/.next/standalone ./
|
||||||
|
COPY --from=builder /app/.next/static ./.next/static
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD ["node", "apps/admin-ui/server.js"]
|
CMD ["node", "server.js"]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue