FROM node:16-alpine WORKDIR /app # Copy package.json and package-lock.json COPY package*.json ./ # Install dependencies RUN npm install # Copy the rest of the application COPY . . # 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 # Start the application with wait script CMD ["/wait-for-mongodb.sh", "npm", "run", "dev"]