# Use alpine:edge with node installed FROM alpine:edge # Install Node.js and Docker CLI RUN apk add --no-cache \ nodejs \ npm \ docker-cli \ tzdata \ bash WORKDIR /app # Copy the script COPY balance.js . # Install dependencies RUN npm install --no-package-lock --omit=dev \ axios \ dockerode \ commander \ && npm cache clean --force # Create non-root user RUN addgroup -g 1001 -S nodejs && \ adduser -S nodejs -u 1001 && \ chown -R nodejs:nodejs /app USER nodejs ENV OFELIA_PORT=8080 \ NODE_ENV=production # Use exec form to ensure signals work properly CMD ["node", "balance.js", "--interval", "60", "--apply"]