FROM node:14-alpine AS base # Set non-interactive mode ENV DEBIAN_FRONTEND=noninteractive ENV NODE_ENV=production # Install chromium RUN apk add --no-cache chromium chromium-chromedriver # Create a symbolic link for google-chrome RUN ln -s /usr/bin/chromium-browser /usr/bin/google-chrome # Set the working directory WORKDIR /app # Copy the package.json and package-lock.json files COPY package*.json ./ # Install dependencies RUN npm install -g npm@9.6.3 && \ npm install # Copy the source code COPY . . # Start the application CMD ["npm", "run", "start"]