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