za / Dockerfile
Aqso's picture
Update Dockerfile
a83eba6 verified
# Gunakan Node.js versi terbaru yang stabil
FROM node:20
# UPGRADE RAM: Alokasikan limit RAM buat Node.js (Contoh: 4096 = 4GB)
ENV NODE_OPTIONS="--max-old-space-size=4096"
# UPGRADE STORAGE: Optimasi cache Puppeteer agar tidak memenuhi disk utama
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable
# Install dependencies sistem buat Puppeteer (Wajib ada biar gak error)
RUN apt-get update && apt-get install -y \
wget \
gnupg \
ca-certificates \
procps \
libxss1 \
--no-install-recommends \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-stable \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json ./
# Install dependencies project
RUN npm install
# Copy seluruh kode (index.js, views.js, dll)
COPY . .
# Expose port Hugging Face
EXPOSE 7860
# Jalankan server
CMD ["node", "index.js"]