docker
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
# Tahap build
|
||||
FROM node:24-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
# Copy semua source code
|
||||
COPY . .
|
||||
|
||||
# Build project Nuxt
|
||||
RUN npm run build
|
||||
|
||||
# Tahap production
|
||||
FROM node:24-alpine AS runner
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Salin hanya file yang dibutuhkan untuk production
|
||||
COPY --from=builder /app/.output ./.output
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/package*.json ./
|
||||
|
||||
# Nuxt 3 menjalankan server dari .output/server/index.mjs
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["node", ".output/server/index.mjs"]
|
||||
#CMD ["npm", "run", "dev"]
|
||||
Reference in New Issue
Block a user