FROM node:20 WORKDIR /app RUN chmod -R 777 /app RUN apt-get update && \ apt-get install -y ffmpeg imagemagick git && \ rm -rf /var/lib/apt/lists/* # Menghapus folder mybot jika ada dan meng-clone ulang repo setiap kali container dijalankan RUN rm -rf /app/mybot # Debugging: Cek apakah cloning berhasil RUN --mount=type=secret,id=GITHUB_REPO,required=true \ git clone $(cat /run/secrets/GITHUB_REPO) mybot && \ ls -lah mybot WORKDIR /app/mybot RUN chmod -R 777 /app/mybot COPY package*.json ./ RUN npm install # Debugging: Cek isi folder setelah install RUN ls -lah /app/mybot # Pastikan setiap restart server otomatis git pull update terbaru CMD bash -c "\ git config --global --add safe.directory /app/mybot && \ rm -rf /app/mybot && \ git clone $(cat /run/secrets/GITHUB_REPO) mybot && \ cd /app/mybot && \ npm install && \ ls -lah /app/mybot && \ node src/server.js"