FROM node:18-alpine

WORKDIR /app

# Install dependencies
COPY package.json package-lock.json* ./
RUN npm ci --only=production

# Copy application files
COPY scripts/reserve/keeper-service.js ./
COPY scripts/reserve/ ./scripts/reserve/

# Create non-root user
RUN addgroup -g 1000 keeper && \
    adduser -D -u 1000 -G keeper keeper && \
    chown -R keeper:keeper /app

USER keeper

# Health check endpoint
EXPOSE 3000

# Start keeper service
CMD ["node", "scripts/reserve/keeper-service.js"]

