update docker
This commit is contained in:
+11
-6
@@ -7,10 +7,10 @@ WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install --legacy-peer-deps
|
||||
|
||||
# Copy semua source code
|
||||
# Salin semua source code
|
||||
COPY . .
|
||||
|
||||
# Build project Nuxt
|
||||
# Build project Nuxt 3
|
||||
RUN npm run build
|
||||
|
||||
# Tahap production
|
||||
@@ -18,13 +18,18 @@ FROM node:24-alpine AS runner
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Salin hanya file yang dibutuhkan untuk production
|
||||
# NODE_ENV untuk optimasi dependency
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# Salin hanya file penting untuk runtime
|
||||
COPY --from=builder /app/.output ./.output
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/package*.json ./
|
||||
COPY --from=builder /app/package.json ./package.json
|
||||
|
||||
# Pastikan ini file ada
|
||||
RUN test -f .output/server/index.mjs
|
||||
|
||||
# Nuxt 3 menjalankan server dari .output/server/index.mjs
|
||||
EXPOSE 3000
|
||||
|
||||
# Jalankan Nuxt 3 SSR
|
||||
CMD ["node", ".output/server/index.mjs"]
|
||||
#CMD ["npm", "run", "dev"]
|
||||
|
||||
Reference in New Issue
Block a user