Dockerfile 1.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
#
# Wechaty Docker
# https://github.com/wechaty/wechaty
#
FROM alpine
MAINTAINER Zhuophuan LI <zixia@zixia.net>

RUN  apk update && apk upgrade \
  && apk add nodejs \
      bash \
      ca-certificates \
      chromium-chromedriver \
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
13
      chromium \
14
      coreutils \
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
15
      figlet \
16
      udev \
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
17
      vim \
18
      xauth \
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
19
      xvfb \
20
  && rm -rf /tmp/* /var/cache/apk/*
21

Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
22
RUN mkdir /wechaty
23
WORKDIR /wechaty
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
24

Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
25
COPY package.json .
26
RUN npm --progress=false install > /dev/null \
27
  && npm --progress=false install -g yarn > /dev/null \
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
28
  && rm -fr /tmp/*
29

Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
30
COPY . .
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
31
RUN npm --progress false link
32

33 34
# 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.
35
RUN mkdir /bot \
36
  && ln -s /usr/local/lib/node_modules / \
37 38
  && ln -s /wechaty/tsconfig.json / \
  && ln -s /wechaty/bin/xvfb-run /usr/local/bin
39

40
VOLUME [ "/bot" ]
41

42
ENTRYPOINT [ "/wechaty/bin/entrypoint.sh" ]
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
43
CMD [ "start" ]
44

45
#RUN npm test