fix: implement Lean Docker strategy with mintel/runtime and remove explicit container_name fields
This commit is contained in:
@@ -20,23 +20,13 @@ ENV DIRECTUS_URL=$DIRECTUS_URL
|
||||
RUN pnpm --filter sample-website build
|
||||
|
||||
# Production runner image
|
||||
FROM node:20-alpine AS runner
|
||||
FROM registry.infra.mintel.me/mintel/runtime:latest AS runner
|
||||
WORKDIR /app
|
||||
|
||||
# Install curl for health checks
|
||||
RUN apk add --no-cache curl
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
COPY --from=builder /app/apps/sample-website/public ./apps/sample-website/public
|
||||
|
||||
# Set the correct permission for prerender cache
|
||||
RUN mkdir -p apps/sample-website/.next
|
||||
RUN chown nextjs:nodejs apps/sample-website/.next
|
||||
RUN mkdir -p apps/sample-website/.next && chown nextjs:nodejs apps/sample-website/.next
|
||||
|
||||
# Copy standalone output and static files from the monorepo path
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/apps/sample-website/.next/standalone ./
|
||||
@@ -44,10 +34,5 @@ COPY --from=builder --chown=nextjs:nodejs /app/apps/sample-website/.next/static
|
||||
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
ENV PORT=3000
|
||||
ENV HOSTNAME="0.0.0.0"
|
||||
|
||||
# server.js in monorepo standalone is created for each app
|
||||
CMD ["node", "apps/sample-website/server.js"]
|
||||
|
||||
Reference in New Issue
Block a user