-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (37 loc) · 944 Bytes
/
Dockerfile
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
FROM ubuntu:18.04
# get node
RUN apt update -y && \
apt install curl -y && \
curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt install nodejs -yq
# install chromium dependencies
RUN apt install -yq libxcursor1 \
libnss3 \
libcups2 \
libxss1 \
libgbm1 \
libasound2 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libcairo2 \
libgtk-3-0 \
libx11-xcb1 \
libxcb-dri3-0 \
libdbus-glib-1-2
# setup the app
RUN mkdir -p /product-watcher
WORKDIR /product-watcher
COPY index.js ./index.js
COPY *.json ./
COPY src ./src
# setup user for puppeteer for sandbox mode
RUN groupadd -r pptruser && \
useradd -r -g pptruser -G audio,video pptruser && \
mkdir -p /home/pptruser/Downloads && \
chown -R pptruser:pptruser /home/pptruser && \
chown -R pptruser:pptruser /product-watcher
# ENV PUPPETEER_PRODUCT=firefox
# install app dependencies
RUN npm install --production
USER pptruser
CMD ["npm", "start"]