Files
drone-detector/data-retention-service/Dockerfile
2025-09-23 13:59:41 +02:00

28 lines
581 B
Docker

# Data Retention Service
FROM node:18-alpine
# Create app directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install only production dependencies
RUN npm install --only=production && npm cache clean --force# Copy source code
COPY . .
# Create non-root user
RUN addgroup -g 1001 -S nodejs
RUN adduser -S retention -u 1001
# Change ownership
RUN chown -R retention:nodejs /app
USER retention
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD node healthcheck.js
# Start the service
CMD ["node", "index.js"]