File size: 696 Bytes
bb2cf03 1424dd1 bb2cf03 1424dd1 bb2cf03 1424dd1 bb2cf03 1424dd1 bb2cf03 a6a6c5a 1424dd1 a6a6c5a bb2cf03 1424dd1 bb2cf03 a6a6c5a bb2cf03 1424dd1 bb2cf03 a6a6c5a 1424dd1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | FROM node:20-slim
# Install system dependencies for Tesseract OCR and Sharp
RUN apt-get update && apt-get install -y --no-install-recommends \
tesseract-ocr \
tesseract-ocr-eng \
libtesseract-dev \
libgl1-mesa-glx \
libvips42 \
python3 \
python3-pip \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Set up app directory with correct ownership
WORKDIR /home/node/app
RUN chown -R node:node /home/node/app
USER node
ENV HOME=/home/node \
PORT=7860
# Install Node dependencies first (layer caching)
COPY --chown=node:node package*.json ./
RUN npm install --omit=dev
# Copy source files
COPY --chown=node:node . .
EXPOSE 7860
CMD ["node", "bot.js"]
|