use pm2
This commit is contained in:
parent
773784ee69
commit
546a4d48cd
23
Dockerfile
23
Dockerfile
@ -4,30 +4,23 @@ WORKDIR /app
|
||||
|
||||
RUN corepack enable
|
||||
|
||||
RUN npm install -g pm2
|
||||
|
||||
# Copy package.json and your lockfile, here we add pnpm-lock.yaml for illustration
|
||||
COPY package.json pnpm-lock.yaml .npmrc ./
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN pnpm i
|
||||
RUN npm i
|
||||
|
||||
# Copy the entire project
|
||||
COPY . ./
|
||||
COPY . .
|
||||
|
||||
# Build the project
|
||||
RUN pnpm run build
|
||||
|
||||
# Build Stage 2
|
||||
|
||||
FROM node:22-alpine
|
||||
WORKDIR /app
|
||||
|
||||
# Only `.output` folder is needed from the build stage
|
||||
COPY --from=build /app/.output/ ./
|
||||
RUN yarn run build
|
||||
|
||||
# Change the port and host
|
||||
ENV PORT=3001
|
||||
ENV HOST=0.0.0.0
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 3001
|
||||
|
||||
CMD ["node", "/app/server/index.mjs"]
|
||||
CMD ["pm2-runtime", "start", "node_modules/.bin/nuxt", "--", "start"]
|
||||
11
ecosystem.config.cjs
Normal file
11
ecosystem.config.cjs
Normal file
@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: 'Smash or Pass',
|
||||
port: '3001',
|
||||
exec_mode: 'cluster',
|
||||
instances: 'max',
|
||||
script: './.output/server/index.mjs'
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user