FROM node:20-alpine # Install MinIO client RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc && \ chmod +x mc && \ mv mc /usr/local/bin/ # Create app directory WORKDIR /app # Copy package files COPY package*.json ./ # Install production dependencies RUN npm ci --only=production # Copy application files COPY . . # Create non-root user RUN addgroup -g 1001 -S nodejs && \ adduser -S nodejs -u 1001 # Create logs directory with proper permissions RUN mkdir -p logs && \ chown -R nodejs:nodejs /app && \ chmod 755 logs # Copy and set permissions for entrypoint COPY docker-entrypoint.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/docker-entrypoint.sh # Switch to non-root user USER nodejs # Expose port EXPOSE 3000 # Start the application ENTRYPOINT ["docker-entrypoint.sh"]