-
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.
[optimize] update Next.js configuration, Docker file & GitHub actions [optimize] upgrade to Node.js 20, KoAJAX 3, MobX RESTful 1 & other latest Upstream packages
- Loading branch information
Showing
14 changed files
with
1,395 additions
and
1,160 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
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
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 |
---|---|---|
@@ -1,21 +1,26 @@ | ||
FROM node:18-slim | ||
FROM node:20-slim AS base | ||
RUN apt-get update && \ | ||
apt-get install ca-certificates curl libjemalloc-dev -y --no-install-recommends && \ | ||
rm -rf /var/lib/apt/lists/* | ||
# set environment variable to preload JEMalloc | ||
ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libjemalloc.so.2" | ||
# set GC time, set arenas number, set background_thread run GC | ||
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
COPY . /app | ||
WORKDIR /app | ||
|
||
USER root | ||
|
||
RUN npm rm yarn -g | ||
RUN npm i pnpm -g | ||
|
||
RUN mkdir /home/node/app | ||
WORKDIR /home/node/app | ||
|
||
COPY package.json pnpm-lock.yaml /home/node/app/ | ||
RUN pnpm i --frozen-lockfile | ||
|
||
COPY . /home/node/app | ||
RUN pnpm build | ||
|
||
RUN pnpm prune --prod || true \ | ||
pnpm store prune | ||
FROM base AS build | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm i --frozen-lockfile | ||
RUN CI=true pnpm build | ||
|
||
FROM base | ||
COPY --from=build /app/public ./public | ||
COPY --from=build /app/.next/static ./.next/static | ||
COPY --from=build /app/.next/standalone ./ | ||
EXPOSE 3000 | ||
CMD ["npm", "start"] | ||
ENV PORT=3000 | ||
ENV HOSTNAME="0.0.0.0" | ||
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 was deleted.
Oops, something went wrong.
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 @@ | ||
import setPWA from 'next-pwa'; | ||
// @ts-ignore | ||
import withLess from 'next-with-less'; | ||
|
||
const { NODE_ENV, CI } = process.env, | ||
withPWA = setPWA({ | ||
dest: 'public', | ||
register: true, | ||
skipWaiting: true, | ||
disable: NODE_ENV === 'development', | ||
}); | ||
|
||
export default withLess(withPWA({ output: CI ? 'standalone' : undefined })); |
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
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.
98bd4b6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for fcc-china ready!
✅ Preview
https://fcc-china-nr4dfr4xg-techquerys-projects.vercel.app
Built with commit 98bd4b6.
This pull request is being automatically deployed with vercel-action