fix: update dockerfile
This commit is contained in:
parent
abb5e0370f
commit
6b72b3e606
14
Dockerfile
14
Dockerfile
|
|
@ -14,10 +14,6 @@ WORKDIR /usr/src/app
|
|||
|
||||
# Salin file penting untuk caching dependencies
|
||||
COPY package.json pnpm-lock.yaml* ./
|
||||
COPY ecosystem.config.js ./
|
||||
|
||||
# Salin vendor jika diperlukan (ckeditor misalnya)
|
||||
COPY vendor/ckeditor5 ./vendor/ckeditor5
|
||||
|
||||
# Install dependencies
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
|
@ -25,11 +21,17 @@ RUN pnpm install --frozen-lockfile
|
|||
# Salin semua source code
|
||||
COPY . .
|
||||
|
||||
# Salin ecosystem config
|
||||
COPY ecosystem.config.js ./
|
||||
|
||||
# Salin vendor jika diperlukan (ckeditor misalnya)
|
||||
COPY vendor/ckeditor5 ./vendor/ckeditor5
|
||||
|
||||
# Build Next.js
|
||||
RUN pnpm run build
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3000
|
||||
|
||||
# Jalankan Next.js dalam mode cluster (gunakan semua core)
|
||||
CMD ["pm2-runtime", "ecosystem.config.js"]
|
||||
# Jalankan Next.js dalam mode cluster
|
||||
CMD ["pm2-runtime", "start", "ecosystem.config.js"]
|
||||
|
|
@ -4,6 +4,7 @@ module.exports = {
|
|||
name: "next-app",
|
||||
script: "node_modules/next/dist/bin/next",
|
||||
args: "start -p 3000",
|
||||
cwd: "/usr/src/app",
|
||||
instances: "max",
|
||||
exec_mode: "cluster",
|
||||
env: {
|
||||
|
|
@ -11,4 +12,4 @@ module.exports = {
|
|||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue