-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(next_and_docker): update nextjs to stable app router version and…
… dockerize the project minor improve code quality at interfaces constants types and utils folder also add editorconfig for format standard BREAKING CHANGE: not ready for vercel production because the app now is dockerize
- Loading branch information
1 parent
8061648
commit 38f3b75
Showing
29 changed files
with
2,193 additions
and
1,015 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,13 @@ | ||
.dockerignore | ||
|
||
.git | ||
|
||
.next | ||
|
||
Dockerfile | ||
|
||
node_modules | ||
|
||
npm-debug.log | ||
|
||
README.md |
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,12 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = crlf | ||
charset = utf-8 | ||
trim_trailing_whitespace = false | ||
insert_final_newline = false |
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 |
---|---|---|
|
@@ -34,7 +34,6 @@ | |
"prettier", | ||
"promise", | ||
"react", | ||
"react-hooks", | ||
"tailwindcss", | ||
"jsdoc" | ||
], | ||
|
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,50 @@ | ||
FROM node:18-alpine AS base | ||
|
||
FROM base AS deps | ||
|
||
RUN apk add --no-cache libc6-compat | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ | ||
|
||
RUN \ | ||
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ | ||
elif [ -f package-lock.json ]; then npm ci; \ | ||
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \ | ||
else echo "Lockfile not found." && exit 1; \ | ||
fi | ||
|
||
FROM base AS builder | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=deps /app/node_modules ./node_modules | ||
|
||
COPY . . | ||
|
||
RUN npm run build | ||
|
||
# Production image, copy all the files and run next | ||
FROM base AS runner | ||
WORKDIR /app | ||
|
||
# Uncomment the following line in case you want to disable telemetry during runtime. | ||
# ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
RUN addgroup --system --gid 1001 nodejs | ||
|
||
RUN adduser --system --uid 1001 infinitedim | ||
|
||
COPY --from=builder /app/public ./public | ||
|
||
|
||
COPY --from=builder --chown=infinitedim:nodejs /app/.next/standalone ./ | ||
|
||
COPY --from=builder --chown=infinitedim:nodejs /app/.next/static ./.next/static | ||
|
||
USER infinitedim | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["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
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
Oops, something went wrong.