This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -23,13 +23,13 @@ RUN ls -la /scripts
|
|||||||
RUN chmod +x ./scripts/*.sh && ./scripts/first_page_image.sh
|
RUN chmod +x ./scripts/*.sh && ./scripts/first_page_image.sh
|
||||||
|
|
||||||
# Run the build command
|
# Run the build command
|
||||||
RUN pnpm run build
|
RUN pnpm build
|
||||||
|
|
||||||
# ---
|
# ---
|
||||||
|
|
||||||
# Stage 2: Runner
|
# Stage 2: Runner
|
||||||
FROM node:20-alpine AS runner
|
FROM node:20-alpine AS runner
|
||||||
WORKDIR /app
|
# WORKDIR /app
|
||||||
|
|
||||||
# Create a non-root user for security
|
# Create a non-root user for security
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
RUN addgroup --system --gid 1001 nodejs
|
||||||
@@ -38,9 +38,9 @@ USER nextjs
|
|||||||
|
|
||||||
# Copy the standalone output from the builder stage
|
# Copy the standalone output from the builder stage
|
||||||
# The './public' directory now contains the newly generated assets
|
# The './public' directory now contains the newly generated assets
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /public ./public
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
COPY --from=builder --chown=nextjs:nodejs .next/standalone ./
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
COPY --from=builder --chown=nextjs:nodejs .next/static ./.next/static
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
|
|||||||
Reference in New Issue
Block a user