FROM node:20-alpine

WORKDIR /app

# Install git and build tools (needed for some npm deps)
RUN apk add --no-cache git python3 make g++

# Install dependencies
COPY whatsapp-bridge-package.json package.json
RUN npm install

# Copy bridge server
COPY whatsapp-bridge-server.js .

# Create auth directory
RUN mkdir -p /app/auth

EXPOSE 21465

CMD ["node", "whatsapp-bridge-server.js"]
