FROM node:lts-alpine # Create app directory and copy the app WORKDIR /app COPY . . # Run as non-root user RUN addgroup -g 1001 -S nodejs RUN adduser -S nodejs -u 1001 RUN chown -R nodejs:nodejs /app USER nodejs # Install RUN npm install # Build RUN npm run build # Start the app ENTRYPOINT ["npm", "run"] CMD ["start"]