FROM node:18

WORKDIR /app

# Install dependensi
COPY package*.json ./
RUN npm install

# Salin semua kode
COPY . .

# Tambah entrypoint
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

# Jalankan entrypoint saat container start
CMD ["/entrypoint.sh"]