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