-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added dockerfile * removed NEXT_TELEMETRY_DISABLED flag in the Dockerfile
- Loading branch information
1 parent
3e547b0
commit aa6531c
Showing
2 changed files
with
48 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,11 @@ | ||
Dockerfile | ||
.dockerignore | ||
node_modules | ||
npm-debug.log | ||
README.md | ||
.next | ||
.git | ||
coverage | ||
.DS_Store | ||
.idea | ||
dist |
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,37 @@ | ||
# Build the source code | ||
FROM node:16-alpine AS builder | ||
RUN apk add --no-cache libc6-compat git python3 py3-pip make g++ | ||
WORKDIR /app | ||
COPY . . | ||
|
||
# install deps | ||
RUN yarn install | ||
|
||
# Next.js collects completely anonymous telemetry data about general usage. | ||
# Learn more here: https://nextjs.org/telemetry | ||
# Uncomment the following line in case you want to disable telemetry during the build. | ||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
RUN yarn build | ||
RUN yarn export | ||
|
||
|
||
# Production image, copy out dir and run serve | ||
FROM node:16-alpine AS runner | ||
WORKDIR /app | ||
|
||
ENV NODE_ENV production | ||
|
||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
|
||
COPY --from=builder /app/out ./out | ||
COPY --from=builder /app/package.json ./package.json | ||
|
||
USER nextjs | ||
|
||
EXPOSE 3000 | ||
|
||
ENV PORT 3000 | ||
|
||
CMD ["yarn", "serve"] |