fixing dockerfile
This commit is contained in:
parent
a62dcf8b34
commit
bcef197e9a
|
|
@ -4,16 +4,14 @@ FROM node:18-alpine AS builder
|
|||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package.json and package-lock.json
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
# Install dependencies
|
||||
# Copy package.json dan install dependencies
|
||||
COPY package.json ./
|
||||
RUN npm install
|
||||
|
||||
# Copy project files
|
||||
# Copy seluruh project
|
||||
COPY . .
|
||||
|
||||
# Build the project
|
||||
# Build project
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Run
|
||||
|
|
@ -22,13 +20,13 @@ FROM node:18-alpine
|
|||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy built files from builder
|
||||
# Copy built files dari stage builder
|
||||
COPY --from=builder /app ./
|
||||
|
||||
# Install only production dependencies
|
||||
RUN npm ci --omit=dev
|
||||
# Install hanya dependencies produksi
|
||||
RUN npm install --omit=dev
|
||||
|
||||
# Expose the application port (sesuaikan dengan port yang digunakan di package.json)
|
||||
# Expose port sesuai dengan package.json (sesuaikan jika berbeda)
|
||||
EXPOSE 8000
|
||||
|
||||
# Jalankan aplikasi dengan npm run preview
|
||||
|
|
|
|||
Loading…
Reference in New Issue