|
1 |
| -# DOCKER-WECHATY-GETTING-STARTED |
| 1 | +# Coderbunker Wechaty Bot |
2 | 2 |
|
3 |
| -[](https://github.com/chatie/wechaty) |
4 |
| -[](https://hub.docker.com/r/zixia/wechaty/) |
5 |
| -[](https://hub.docker.com/r/zixia/wechaty/) |
6 |
| -[](https://microbadger.com/#/images/zixia/wechaty) |
7 |
| -[](https://travis-ci.com/Chatie/docker-wechaty-getting-started) |
8 | 3 |
|
9 |
| -[](https://hub.docker.com/r/zixia/wechaty/) |
10 |
| - |
11 |
| -Getting Started Template for Docker Users |
12 | 4 |
|
13 | 5 | ## FEATURES
|
14 | 6 |
|
15 |
| -1. Wechaty is fully dockerized. So it will be very easy to be used as a MicroService. |
16 |
| -1. Clone this repository, then you will be able to use Docker to run Wechaty with ZERO configuration. |
| 7 | + |
17 | 8 |
|
18 | 9 | ## REQUIREMENTS
|
19 | 10 |
|
20 | 11 | 1. Docker
|
21 |
| -1. Global Internet Connection |
| 12 | +2. Node.js v10.16.0 |
| 13 | +3. yarn |
22 | 14 |
|
23 | 15 | ## USAGE
|
24 | 16 |
|
25 |
| -### 1. Run Bot Examples |
26 |
| - |
27 |
| -#### 1.1 Run Vanilla Javascript Example |
28 |
| - |
29 |
| -Source code at `src/javascript-vanilla.js` |
| 17 | +### 1. Install Dependencies |
30 | 18 |
|
31 |
| -```shell |
32 |
| -bin/docker-run-javascript-vanilla.sh |
33 | 19 | ```
|
34 |
| - |
35 |
| -#### 1.2. Run ES6 Javascript Example |
36 |
| - |
37 |
| -Source code at `src/javascript-es6.js` |
38 |
| - |
39 |
| -```shell |
40 |
| -bin/docker-run-javascript-es6.sh |
| 20 | +yarn install |
41 | 21 | ```
|
42 | 22 |
|
43 |
| -#### 1.3 Run TypeScript Example |
| 23 | +### 2. Make Docker Run |
44 | 24 |
|
45 |
| -Source code at `src/typescript.ts` |
| 25 | +### 3. Run the Project |
46 | 26 |
|
47 |
| -```shell |
48 |
| -bin/docker-run-typescript.sh |
49 | 27 | ```
|
50 |
| - |
51 |
| -### 2. Set Environment Variables |
52 |
| - |
53 |
| -The above scripts(`bin/docker-run-*.sh`) will pass all environment variables that start with `WECHATY_` from current shell to the Docker container. |
54 |
| - |
55 |
| -All you need is just to set it under the shell before you run the `bin/docker-run-*.sh`. |
56 |
| - |
57 |
| -```shell |
58 |
| -export WECHATY_LOG=verbose |
| 28 | +yarn start |
59 | 29 | ```
|
60 | 30 |
|
61 |
| -## DOCKER |
| 31 | +### Others |
62 | 32 |
|
63 |
| -### Install Docker |
| 33 | +#### Code Style Testing with ESLint |
64 | 34 |
|
65 |
| -Quick & easy install Docker via: |
| 35 | +Coderbunker Wechaty Bot supports Airbnb's JavaScript Style by ESLint. To test if your code is with the right code style, you have to run ESLint: |
66 | 36 |
|
67 |
| -```shell |
68 |
| -curl -sSL https://get.docker.com | sh |
69 | 37 | ```
|
70 |
| - |
71 |
| -Or |
72 |
| - |
73 |
| -```shell |
74 |
| -wget -qO- https://get.docker.com/ | sh |
| 38 | +yarn run lint |
75 | 39 | ```
|
76 | 40 |
|
77 |
| -Get to know more about Docker at: <https://www.docker.com/> |
78 |
| - |
79 |
| -### Use Docker Registry China Mirror |
80 |
| - |
81 |
| -Thanks Docker, there's a official registry mirror in China, and you can use it by adding `registry.docker-cn.com/` in front of the image name: |
82 |
| - |
83 |
| -```diff |
84 |
| -- docker pull zixia/wechaty |
85 |
| -+ docker pull registry.docker-cn.com/zixia/wechaty |
86 |
| -``` |
87 |
| - |
88 |
| -Learn more about CN mirror: |
89 |
| - |
90 |
| -- https://www.docker-cn.com/registry-mirror |
91 |
| -- https://docs.docker.com/registry/recipes/mirror/#use-case-the-china-registry-mirror |
92 |
| - |
93 |
| -## TEST |
94 |
| - |
95 |
| -BATS: [HOW TO USE BATS TO TEST YOUR COMMAND LINE TOOLS](https://www.engineyard.com/blog/bats-test-command-line-tools) |
96 |
| - |
97 |
| -## SEE ALSO |
98 |
| - |
99 |
| -1. Wechaty Getting Started: <https://github.com/wechaty/wechaty-getting-started> |
100 |
| -2. Heroku Wechaty Getting Started: <https://github.com/wechaty/heroku-wechaty-getting-started> |
101 |
| - |
102 |
| -## AUTHOR |
103 |
| - |
104 |
| -[Huan LI ](http://linkedin.com/in/zixia) \<[email protected]\> |
105 |
| - |
106 |
| -<a href="https://stackexchange.com/users/265499"> |
107 |
| - <img src="https://stackexchange.com/users/flair/265499.png" width="208" height="58" alt="profile for zixia on Stack Exchange, a network of free, community-driven Q&A sites" title="profile for zixia on Stack Exchange, a network of free, community-driven Q&A sites"> |
108 |
| -</a> |
109 |
| - |
110 |
| -## COPYRIGHT & LICENSE |
| 41 | +## SPECIAL THANKS |
111 | 42 |
|
112 |
| -- Code & Docs © 2018 Huan LI \<[email protected]\> |
113 |
| -- Code released under the Apache-2.0 License |
114 |
| -- Docs released under Creative Commons |
| 43 | +Based on [wechaty/docker-wechaty-getting-started](https://github.com/wechaty/docker-wechaty-getting-started) |
0 commit comments