Fix harness Dockerfile standalone paths for monorepo workspace build
All checks were successful
CI / lint-and-test (push) Successful in 29s
Deploy Production / deploy (push) Successful in 1m9s
CI / build (push) Successful in 1m42s

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:
Julia McGhee
2026-03-21 20:35:09 +00:00
parent a687652bcd
commit ff0573703f

View File

@@ -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"]