Skip to content

Commit

Permalink
Merge pull request #10 from infinitedim/feat/app_router
Browse files Browse the repository at this point in the history
feat(next_and_docker): update nextjs to stable app router version...
  • Loading branch information
infinitedim authored Aug 27, 2023
2 parents 8061648 + 38f3b75 commit 932236f
Show file tree
Hide file tree
Showing 29 changed files with 2,193 additions and 1,015 deletions.
13 changes: 13 additions & 0 deletions .dockerignore
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
12 changes: 12 additions & 0 deletions .editorconfig
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
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"prettier",
"promise",
"react",
"react-hooks",
"tailwindcss",
"jsdoc"
],
Expand Down
50 changes: 50 additions & 0 deletions Dockerfile
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"]
4 changes: 1 addition & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
const nextConfig = {
swcMinify: true,
reactStrictMode: true,
experimental: {
appDir: true,
},
output: "standalone",
};

module.exports = nextConfig;
24 changes: 14 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package",
"name": "portfolio",
"version": "0.1.1",
"version": "2.1.1",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down Expand Up @@ -38,14 +38,18 @@
]
},
"dependencies": {
"@mdx-js/loader": "^2.3.0",
"@mdx-js/react": "^2.3.0",
"@next/mdx": "^13.4.12",
"@types/mdx": "^2.0.5",
"@vercel/analytics": "^1.0.1",
"class-variance-authority": "^0.6.1",
"clsx": "^1.2.1",
"framer-motion": "^10.12.10",
"next": "13.2.4",
"next": "13.4.10",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwind-merge": "^1.12.0"
"tailwind-merge": "^1.14.0"
},
"devDependencies": {
"@jridgewell/sourcemap-codec": "^1.4.15",
Expand All @@ -54,18 +58,18 @@
"@tailwindcss/line-clamp": "^0.4.4",
"@tailwindcss/typography": "^0.5.9",
"@total-typescript/ts-reset": "^0.4.2",
"@types/node": "18.15.11",
"@types/react": "18.0.31",
"@types/react-dom": "18.0.11",
"@types/node": "20.4.2",
"@types/react": "18.2.15",
"@types/react-dom": "18.2.7",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"autoprefixer": "^10.4.14",
"autoprefixer": "10.4.14",
"commitizen": "^4.3.0",
"cssnano": "^6.0.1",
"cz-conventional-changelog": "^3.3.0",
"eslint": "8.37.0",
"eslint": "8.45.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-next": "13.2.4",
"eslint-config-next": "13.4.10",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsdoc": "^41.1.2",
Expand All @@ -77,7 +81,7 @@
"eslint-plugin-tailwindcss": "^3.11.0",
"husky": "^8.0.3",
"lint-staged": "^13.2.2",
"postcss": "^8.4.23",
"postcss": "8.4.26",
"prettier": "^2.8.8",
"tailwindcss": "^3.3.2",
"typescript": "5.0.4"
Expand Down
Loading

1 comment on commit 932236f

@vercel
Copy link

@vercel vercel bot commented on 932236f Aug 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.