-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (43 loc) · 1.22 KB
/
Dockerfile
File metadata and controls
52 lines (43 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM node:20-slim
# install Chrome dependencies
RUN apt-get update && apt-get install -y \
wget \
gnupg \
ca-certificates \
procps \
libxss1 \
libnss3 \
libatk-bridge2.0-0 \
libgtk-3-0 \
libx11-xcb1 \
libxcb-dri3-0 \
libdrm2 \
libgbm1 \
libasound2 \
fonts-liberation \
xdg-utils \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# install Chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-stable --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# set working directory
WORKDIR /app
# copy package files and install dependencies
COPY package*.json ./
RUN npm install
# copy all project files
COPY . .
# create directories for results
RUN mkdir -p json_results csv_results
# set environment variables
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome
ENV PORT=10000
# expose port for web interface
EXPOSE 10000
# start the web server
CMD ["node", "web-server.js"]