From e06e6f86699dfc92d237577086c64a111e71d87b Mon Sep 17 00:00:00 2001 From: Thatsaphorn Atchariyaphap Date: Tue, 1 Jul 2025 17:24:21 +0900 Subject: [PATCH] Add Dockerfile for `internal_frontend` production deployment --- internal_frontend/Dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 internal_frontend/Dockerfile diff --git a/internal_frontend/Dockerfile b/internal_frontend/Dockerfile new file mode 100644 index 0000000..c57f214 --- /dev/null +++ b/internal_frontend/Dockerfile @@ -0,0 +1,25 @@ +# Use a lightweight Node.js 20 Alpine image (digest-pinned for reproducibility) +FROM node:20-alpine@sha256:9bef0ef1e268f60627da9ba7d7605e8831d5b56ad07487d24d1aa386336d1944 + +# Set the working directory inside the container +WORKDIR /app + +# Copy only the production-ready files built in CI +# These files must be passed as GitLab artifacts: +# - .next/ → built Next.js app +# - public/ → static assets +# - package.json → app manifest +# - package-lock.json → to lock dependencies for reproducibility +COPY .next .next +COPY public public +COPY package.json package.json +COPY package-lock.json package-lock.json + +# Install only production dependencies to reduce image size +RUN npm ci --omit=dev + +# Expose the port that Next.js serves on (default is 3000) +EXPOSE 3000 + +# Start the Next.js app in production mode +CMD ["npm", "run", "start"]