forked from wechaty/wechaty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.node
49 lines (39 loc) · 1.5 KB
/
Dockerfile.node
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
FROM node:7
ENV NPM_CONFIG_LOGLEVEL warn
# Installing the 'apt-utils' package gets rid of the 'debconf: delaying package configuration, since apt-utils is not installed'
# error message when installing any other package with the apt-get package manager.
# https://peteris.rocks/blog/quiet-and-unattended-installation-with-apt-get/
RUN apt-get update > /dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
apt-utils \
> /dev/null 2>&1 \
&& rm -rf /var/lib/apt/lists/*
# 1. xvfb depend on xauth
# 2. chromium(with webdriver) depend on libgconf-2-4
RUN apt-get update > /dev/null \
&& DEBIAN_FRONTEND=noninteractive apt-get -qqy --no-install-recommends -o Dpkg::Use-Pty=0 install \
chromium \
figlet \
libgconf-2-4 \
vim \
xauth \
xvfb \
> /dev/null \
&& rm -rf /tmp/* /var/lib/apt/lists/*
RUN mkdir /wechaty
WORKDIR /wechaty
COPY package.json .
RUN npm --progress=false install > /dev/null \
&& npm --progress=false install -g yarn > /dev/null \
&& rm -fr /tmp/*
# && npm install ts-node typescript -g \
COPY . .
RUN npm --progress false link
# Loading from node_modules Folders: https://nodejs.org/api/modules.html
# If it is not found there, then it moves to the parent directory, and so on, until the root of the file system is reached.
RUN mkdir /bot \
&& ln -s /usr/local/lib/node_modules / \
&& ln -s /wechaty/tsconfig.json /
VOLUME [ "/bot" ]
ENTRYPOINT [ "/wechaty/bin/entrypoint.sh" ]
CMD [ "start" ]
#RUN npm test