Fix harness Dockerfile standalone paths for monorepo workspace build
Next.js standalone output nests server.js under apps/harness/ when built from a pnpm workspace. Preserve the directory structure and update CMD to point to the correct server.js path.
This commit is contained in:
@@ -37,10 +37,10 @@ RUN adduser --system --uid 1001 nextjs
|
|||||||
# Workspace directory for git worktrees (ephemeral)
|
# Workspace directory for git worktrees (ephemeral)
|
||||||
RUN mkdir -p /data/harness && chown nextjs:nodejs /data/harness
|
RUN mkdir -p /data/harness && chown nextjs:nodejs /data/harness
|
||||||
|
|
||||||
COPY --from=builder /app/apps/harness/public ./public
|
COPY --from=builder /app/apps/harness/public ./apps/harness/public
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/apps/harness/.next/standalone ./
|
COPY --from=builder --chown=nextjs:nodejs /app/apps/harness/.next/standalone ./
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/apps/harness/.next/static ./.next/static
|
COPY --from=builder --chown=nextjs:nodejs /app/apps/harness/.next/static ./apps/harness/.next/static
|
||||||
USER nextjs
|
USER nextjs
|
||||||
EXPOSE 3100
|
EXPOSE 3100
|
||||||
ENV PORT=3100
|
ENV PORT=3100
|
||||||
CMD ["node", "server.js"]
|
CMD ["node", "apps/harness/server.js"]
|
||||||
|
|||||||
Reference in New Issue
Block a user