-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5d1893
commit 7be1ac0
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM node:20-slim AS base | ||
WORKDIR /app | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN npm config set registry https://registry.npmmirror.com | ||
RUN npm i -g pnpm | ||
|
||
# Install dependencies and build the application | ||
FROM base AS builder | ||
WORKDIR /app | ||
COPY package.json pnpm-lock.yaml ./ | ||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
ENV OUTPUT_STANDALONE 1 | ||
# Use the npm mirror to speed up the installation | ||
RUN pnpm config set registry https://registry.npmmirror.com && pnpm install --frozen-lockfile | ||
COPY . . | ||
RUN pnpm run build | ||
|
||
# Install production dependencies only | ||
RUN pnpm install --prod --ignore-scripts --prefer-offline | ||
|
||
# Use alpine for the final image to reduce the image size | ||
FROM node:20-alpine AS runner | ||
WORKDIR /app | ||
|
||
|
||
COPY --from=builder /app/.next/standalone ./ | ||
COPY --from=builder /app/.next/static ./.next/static | ||
COPY --from=builder /app/public ./public | ||
|
||
# Set environment variables | ||
ENV NODE_ENV production | ||
ENV PORT 3000 | ||
|
||
EXPOSE 3000 | ||
|
||
# Just pass HOSTNAME to node server.js | ||
CMD HOSTNAME="0.0.0.0" node server.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ const nextConfig = { | |
}, | ||
], | ||
}, | ||
output: "standalone", | ||
}; | ||
|
||
export default nextConfig; |