update docker
This commit is contained in:
parent
973419c093
commit
8da2c2da5f
17
Dockerfile
17
Dockerfile
@ -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"]
|
||||
|
||||
@ -6,6 +6,4 @@ services:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
volumes:
|
||||
- .:/app
|
||||
restart: unless-stopped
|
||||
|
||||
Loading…
Reference in New Issue
Block a user