mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 12:41:04 +00:00
add a pnpm deploy step
This commit is contained in:
@@ -42,24 +42,20 @@ COPY --from=installer /app/ .
|
||||
COPY --from=pruner /app/out/full/ .
|
||||
RUN pnpm turbo build --filter="${APP_PACKAGE}..."
|
||||
|
||||
FROM base AS runner
|
||||
FROM base AS deployer
|
||||
ARG APP_PACKAGE
|
||||
COPY --from=builder /app/ .
|
||||
RUN pnpm deploy --filter="${APP_PACKAGE}" --prod --legacy /deploy
|
||||
|
||||
FROM node:24.15.0-alpine AS runner
|
||||
ARG APP_PATH
|
||||
ARG PORT=5174
|
||||
ENV PORT=${PORT}
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# Copy built app (Next.js output)
|
||||
COPY --from=builder /app/${APP_PATH}/.next /app/.next
|
||||
COPY --from=builder /app/${APP_PATH}/public /app/public
|
||||
COPY --from=builder /app/${APP_PATH}/package.json /app/package.json
|
||||
|
||||
# Copy node_modules (required for Next.js runtime)
|
||||
COPY --from=builder /app/node_modules /app/node_modules
|
||||
|
||||
# Use node user for security
|
||||
WORKDIR /app
|
||||
COPY --from=deployer /deploy .
|
||||
COPY --from=builder /app/${APP_PATH}/.next .next
|
||||
COPY --from=builder /app/${APP_PATH}/public public
|
||||
USER node
|
||||
|
||||
EXPOSE ${PORT}
|
||||
|
||||
# Start Next.js standalone server
|
||||
CMD ["node", ".next/standalone/server.js"]
|
||||
|
||||
Reference in New Issue
Block a user