crawling-and-serving/Dockerfile

27 lines
568 B
Docker
Raw Normal View History

FROM node:14-alpine AS base
2023-04-18 12:54:49 +00:00
# Set non-interactive mode
ENV DEBIAN_FRONTEND=noninteractive
2023-04-18 14:35:49 +00:00
ENV NODE_ENV=production
2023-04-18 12:54:49 +00:00
# Install chromium
RUN apk add --no-cache chromium chromium-chromedriver
2023-04-18 12:54:49 +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
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
CMD ["npm", "run", "start"]