This commit is contained in:
2025-07-13 20:23:08 +02:00
parent 773784ee69
commit 546a4d48cd
2 changed files with 19 additions and 15 deletions

View File

@@ -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"]