FROM node:22-alpine WORKDIR /app/backend USER root # Expose port 5000 EXPOSE 5000 # Add wait-for script COPY wait-for-mongodb.sh /wait-for-mongodb.sh RUN chmod +x /wait-for-mongodb.sh # Install dependencies and start the application CMD ["sh", "-c", "/wait-for-mongodb.sh && npm install && npm run dev"]