NAM-APJATEL/deploy/docker/Dockerfile

32 lines
567 B
Docker

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
RUN npm install
# Copy project files
COPY . .
# Build the project
RUN npm run start
# Final stage
FROM node:18-alpine
# Set working directory
WORKDIR /app
# Copy built files from builder
COPY --from=builder /app ./
# Expose the application port (sesuaikan dengan port yang digunakan di package.json)
EXPOSE 4173
# Jalankan aplikasi dengan npm run preview
CMD ["npm", "run", "preview"]