Dockerfile 775 字节
Newer Older
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
1
FROM node:6
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
2

3
# RUN mkdir /tmp/.X11-unix/ && chmod 777 /tmp/.X11-unix/
4
RUN apt-get update && apt-get install -y \
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
5
  apt-utils \
6
  dbus-x11 \
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
7
  xvfb
8

9 10 11 12 13 14
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
  && sh -c 'echo "deb 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 \
  && google-chrome --version

15
# RUN groupadd -r wechaty && useradd -m -r -g wechaty wechaty -d /wechaty
16 17

WORKDIR /wechaty
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
18 19
COPY package.json .
RUN npm install
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
20
COPY . .
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
21 22 23
RUN npm link \
  && bash -n entrypoint.sh \
  && chmod a+x entrypoint.sh
24

Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
25
ENTRYPOINT [ "/wechaty/entrypoint.sh" ]
Huan (李卓桓)'s avatar
Huan (李卓桓) 已提交
26
CMD [ "start" ]
27

28 29
# RUN chown -R wechaty.wechaty /wechaty
# USER wechaty