Refactor Dockerfile and .dockerignore for clarity and build context. Updated paths in Dockerfile.prebuilt to reflect new directory structure and improved .dockerignore to better manage ignored files. Enhanced GitHub Actions workflow to ensure proper build context for Docker image creation.

This commit is contained in:
smhk1376 committed 2026-09-24 15:31:06 +03:30
1 parent 9b48611a61
commit 13d122e905
3 files changed
+23 -18

No files matched your search

+7 -7
View File
@@ -1,8 +1,8 @@
# Packs a pre-built Next.js standalone output — no npm / next build on the server.
# Expects build context:
# prebuilt/standalone/ ← contents of .next/standalone
# prebuilt/static/ ← contents of .next/static
# prebuilt/public/ ← public/
# Build context must be the `prebuilt/` directory:
# standalone/ ← contents of .next/standalone (includes .next/BUILD_ID + node_modules)
# static/ ← contents of .next/static
# public/ ← public/
FROM node:22-alpine AS runner
WORKDIR /app
@@ -14,9 +14,9 @@ ENV HOSTNAME=0.0.0.0
RUN addgroup --system --gid 1001 nodejs \
&& adduser --system --uid 1001 nextjs
COPY --chown=nextjs:nodejs prebuilt/standalone/ ./
COPY --chown=nextjs:nodejs prebuilt/public ./public
COPY --chown=nextjs:nodejs prebuilt/static ./.next/static
COPY --chown=nextjs:nodejs standalone/ ./
COPY --chown=nextjs:nodejs public ./public
COPY --chown=nextjs:nodejs static ./.next/static
USER nextjs