FROM node:22-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
    git ca-certificates \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app
RUN npm install -g @bitwarden/cli
COPY package.json ./
RUN npm install --production
COPY src/ ./src/
COPY start.sh ./
RUN chmod +x start.sh
CMD ["./start.sh"]
