# Gunakan image Node.js yang ringan
FROM node:23.5.0-alpine

# Set port
ENV PORT 3000

# Set working directory
WORKDIR /usr/src/app

# Copy package.json dan package-lock.json (kalau ada)
COPY package*.json ./

# Copy vendor ckeditor (jika memang perlu sebelum install)
COPY vendor/ckeditor5 ./vendor/ckeditor5

# Install dependencies
RUN npm install

# Copy semua source code
COPY . .

# Build aplikasi
RUN npm run build

# Expose port
EXPOSE 3000

# Jalankan aplikasi
CMD ["npm", "run", "start"]
