updated dependency, standalone seems to work
updated pnpm version added dockerignore revert the standalone output
This commit is contained in:
parent
5c8a3f56dd
commit
bea1c3aba3
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
**/node_modules
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.local
|
||||||
|
.env*
|
||||||
@ -1,2 +1,2 @@
|
|||||||
nodejs 20.8.1
|
nodejs 20.8.1
|
||||||
pnpm 8.9.2
|
pnpm 8.15.3
|
||||||
|
|||||||
31
Dockerfile
31
Dockerfile
@ -1,8 +1,37 @@
|
|||||||
FROM node:lts-alpine as builder
|
FROM node:lts-alpine as base
|
||||||
|
|
||||||
|
FROM base as builder
|
||||||
USER 1000:1000
|
USER 1000:1000
|
||||||
ADD --chown=1000:1000 . /home/node/nextts
|
ADD --chown=1000:1000 . /home/node/nextts
|
||||||
WORKDIR /home/node/nextts
|
WORKDIR /home/node/nextts
|
||||||
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="/home/node/.shrc" SHELL="$(which sh)" sh -
|
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="/home/node/.shrc" SHELL="$(which sh)" sh -
|
||||||
ENV PATH=/home/node/.local/share/pnpm:$PATH
|
ENV PATH=/home/node/.local/share/pnpm:$PATH
|
||||||
RUN pnpm install && pnpm run build
|
RUN pnpm install && pnpm run build
|
||||||
|
|
||||||
|
FROM base as runtime
|
||||||
|
|
||||||
|
RUN npm install -g pm2
|
||||||
|
|
||||||
|
|
||||||
|
COPY --from=builder /home/node/nextts/public /home/node/nextts/public
|
||||||
|
COPY --from=builder /home/node/nextts/.next/standalone /home/node/nextts
|
||||||
|
COPY --from=builder /home/node/nextts/.next/static /home/node/nextts/.next/static
|
||||||
|
ADD --chown=1000:1000 pm2.config.js /home/node/nextts/
|
||||||
|
ADD --chown=1000:1000 dummies /home/node/nextts/dummies
|
||||||
|
|
||||||
|
RUN chown -R 1000:1000 /home/node/nextts
|
||||||
|
|
||||||
|
USER 1000:1000
|
||||||
|
WORKDIR /home/node/nextts
|
||||||
|
|
||||||
|
ENV PORT 3000
|
||||||
|
ENV NODE_ENV production
|
||||||
|
ENV HOME /home/node
|
||||||
|
ENV HOSTNAME "0.0.0.0"
|
||||||
|
|
||||||
|
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="/home/node/.shrc" SHELL="$(which sh)" sh -
|
||||||
|
ENV PATH=/home/node/.local/share/pnpm:$PATH
|
||||||
|
RUN pnpm install
|
||||||
|
|
||||||
|
CMD ["pm2-runtime", "pm2.config.js"]
|
||||||
|
#CMD ["node", "server.js"]
|
||||||
|
|||||||
13
package.json
13
package.json
@ -9,24 +9,25 @@
|
|||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/dompurify": "^3.0.3",
|
"@types/dompurify": "^3.0.5",
|
||||||
"@types/jsdom": "^21.1.3",
|
"@types/jsdom": "^21.1.6",
|
||||||
"@types/node": "20.6.5",
|
"@types/node": "20.6.5",
|
||||||
"@types/react": "18.2.22",
|
"@types/react": "18.2.22",
|
||||||
"@types/react-dom": "18.2.7",
|
"@types/react-dom": "18.2.7",
|
||||||
"autoprefixer": "10.4.16",
|
"autoprefixer": "10.4.16",
|
||||||
"bright": "^0.8.4",
|
"bright": "^0.8.4",
|
||||||
"dompurify": "^3.0.6",
|
"dompurify": "^3.0.9",
|
||||||
"eslint": "8.50.0",
|
"eslint": "8.50.0",
|
||||||
"eslint-config-next": "13.5.2",
|
"eslint-config-next": "13.5.2",
|
||||||
"html-react-parser": "^4.2.2",
|
"html-react-parser": "^4.2.10",
|
||||||
"jsdom": "^22.1.0",
|
"jsdom": "^22.1.0",
|
||||||
"mysql2": "^3.6.1",
|
"mysql2": "^3.9.1",
|
||||||
"next": "13.5.2",
|
"next": "13.5.2",
|
||||||
"postcss": "8.4.30",
|
"postcss": "8.4.30",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-dom": "18.2.0",
|
"react-dom": "18.2.0",
|
||||||
"redis": "^4.6.10",
|
"redis": "^4.6.13",
|
||||||
|
"sharp": "^0.33.2",
|
||||||
"tailwindcss": "3.3.3",
|
"tailwindcss": "3.3.3",
|
||||||
"typescript": "5.2.2"
|
"typescript": "5.2.2"
|
||||||
},
|
},
|
||||||
|
|||||||
7
pm2.config.js
Normal file
7
pm2.config.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
module.exports = {
|
||||||
|
apps: [{
|
||||||
|
script: "server.js",
|
||||||
|
instances: 4,
|
||||||
|
exec_mode: "cluster"
|
||||||
|
}]
|
||||||
|
}
|
||||||
1522
pnpm-lock.yaml
generated
1522
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user