FROM node:22-alpine
WORKDIR /app

# No dependencies to install: server.js uses only Node's built-in modules.
COPY package.json ./
COPY server.js ./
COPY tools ./tools
COPY skills ./skills

# Run as the "node" user baked into this image, not root. /app/data is
# where the token quota file and sign-in audit log get written (mounted
# as a volume in docker-compose.yml), so it needs to be writable by that
# user before the switch.
RUN mkdir -p /app/data && chown -R node:node /app
USER node

ENV PORT=5173
EXPOSE 5173

CMD ["node", "server.js"]
