diff --git a/Dockerfile b/Dockerfile index 16a60d9a..551071a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,4 +31,4 @@ RUN pnpm run build EXPOSE 3000 # Jalankan Next.js dalam mode cluster (gunakan semua core) -CMD ["pm2-runtime", "start", "node_modules/next/dist/bin/next", "-i", "max", "--name", "next-app", "--", "start", "-p", "3000"] \ No newline at end of file +CMD ["pm2-runtime", "ecosystem.config.js"] \ No newline at end of file diff --git a/ecosystem.config.js b/ecosystem.config.js new file mode 100644 index 00000000..30c15de8 --- /dev/null +++ b/ecosystem.config.js @@ -0,0 +1,14 @@ +module.exports = { + apps: [ + { + name: "next-app", + script: "node_modules/next/dist/bin/next", + args: "start -p 3000", + instances: "max", + exec_mode: "cluster", + env: { + NODE_ENV: "production" + } + } + ] +}