crawling-and-serving/Dockerfile

28 lines
549 B
Docker
Raw Normal View History

2023-04-18 12:54:49 +00:00
FROM ubuntu:20.04 AS base
# 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 required packages
RUN apt-get update && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs chromium-browser
2023-04-19 07:53:12 +00:00
RUN apt-get install -y npm
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
# Copy the source code
COPY . .
# Start the application
2023-04-19 08:10:15 +00:00
CMD ["npm", "run", "start"]