my / Dockerfile
understanding's picture
Update Dockerfile
eca2942 verified
raw
history blame contribute delete
643 Bytes
FROM node:20-alpine
WORKDIR /app
# Install system dependencies & optimize npm
RUN apk add --no-cache git && \
npm install -g [email protected]
# Copy package files and install dependencies
COPY package*.json ./
RUN npm install --omit=dev && \
npm cache clean --force
# Copy application files
COPY . .
# Create required directories with proper permissions
RUN mkdir -p \
./auth \
./session \
./downloads \
./auth_info_baileys && \
chown -R node:node \
./auth \
./session \
./downloads \
./auth_info_baileys
# Switch to non-root user for security
USER node
CMD ["node", "src/index.js"]