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

30 lines
543 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 ci --only=production
# 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"]