Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions samples/nextjs/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
1 change: 1 addition & 0 deletions samples/nextjs/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading