From 2aacce70500203cf2405bd6034be027a6cba0fe9 Mon Sep 17 00:00:00 2001 From: Kevin Vo Date: Thu, 17 Jul 2025 15:50:21 -0700 Subject: [PATCH] Revert --- samples/nextjs/app/Dockerfile | 30 ++++++++++++++++++++++++++++++ samples/nextjs/compose.yaml | 1 + 2 files changed, 31 insertions(+) create mode 100644 samples/nextjs/app/Dockerfile diff --git a/samples/nextjs/app/Dockerfile b/samples/nextjs/app/Dockerfile new file mode 100644 index 00000000..1d13e0a3 --- /dev/null +++ b/samples/nextjs/app/Dockerfile @@ -0,0 +1,30 @@ +# Start from the official Node.js LTS image +FROM node:20-alpine + +# Set the working directory +WORKDIR /app + +# Copy package.json and package-lock.json +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the rest of your app's source code +COPY . . + +# Build the Next.js app +ARG NEXT_OUTPUT +RUN npm run build + +# If we're doing an export, copy all files from the out directory to /static +# This is a workaround for Next.JS issue https://github.com/vercel/next.js/issues/59988 +RUN if [ "$NEXT_OUTPUT" = "export" ]; then \ + cp -R out/* /static/; \ + fi + +# Expose the port that your app runs on +EXPOSE 3000 + +# Start the app +CMD ["npm", "start"] \ No newline at end of file diff --git a/samples/nextjs/compose.yaml b/samples/nextjs/compose.yaml index 4ff7321c..7b16a49f 100644 --- a/samples/nextjs/compose.yaml +++ b/samples/nextjs/compose.yaml @@ -4,6 +4,7 @@ services: # domainname: www.example.xyz # uncomment if you want to use your own domain build: context: ./app + dockerfile: Dockerfile ports: - target: 3000