Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files12345678910111213141516171819202122232425FROM ubuntu:22.04ENV DEBIAN_FRONTEND=noninteractive# Install Node.js 18 + TesseractRUN apt-get update && apt-get install -y \curl gnupg ca-certificates tesseract-ocr libtesseract-dev \&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \&& apt-get install -y nodejs \&& rm -rf /var/lib/apt/lists/*# Buat user non-rootRUN useradd -m userUSER userWORKDIR /home/user/app# Copy package.jsonCOPY --chown=user:user package*.json ./RUN npm install# Copy source code#COPY --chown=user:user . .# Jalankan#CMD ["node", "server.js"]12345678910111213141516171819202122232425262728# Gunakan base image Linux dengan Node.js 18FROM node:18-slim# Install Tesseract OCR dan dependensi yang dibutuhkanRUN apt-get update && apt-get install -y \tesseract-ocr \libtesseract-dev \python3 \build-essential \&& rm -rf /var/lib/apt/lists/*# Buat folder kerjaWORKDIR /app# Copy file package.json & package-lock.jsonCOPY package*.json ./# Install dependencies Node.jsRUN npm install# Copy semua source code ke containerCOPY . .# Hugging Face Spaces butuh listen ke port 7860 atau $PORTENV PORT=7860# Jalankan server Node.jsCMD ["node", "server.js"]
Dockerfile+20-17