docke一键安装酷Q搭建个人QQ机器人
docker一键安装酷Q搭建个人QQ机器人
一,通过docker 运行容器
先下载coolq镜像
1
2
3docker pull coolq/wine-coolq
mkdir /data/coolq/coolq-data/ -p创建一个nginx.conf文件
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94vim /data/coolq/coolq-data/nginx.conf
user user user;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 768;
multi_accept on;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
set_real_ip_from 10.0.0.0/8;
set_real_ip_from 100.64.0.0/10;
set_real_ip_from 169.254.0.0/16;
set_real_ip_from 172.16.0.0/12;
set_real_ip_from 192.168.0.0/16;
real_ip_header X-Forwarded-For;
real_ip_recursive off;
server_names_hash_bucket_size 64;
server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
access_log /dev/stdout;
error_log /dev/stderr;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
map $http_x_forwarded_proto $upstream_https {
default "$https";
"https" "on";
"http" "";
}
map $http_x_forwarded_proto $upstream_scheme {
default "$scheme";
"https" "https";
"http" "http";
}
map $http_x_forwarded_host $upstream_server_name {
"" "$server_name";
default "$http_x_forwarded_host";
}
server {
listen 9000 default_server;
root /app/src/novnc;
index index.html index.htm;
server_name _;
location / {
index vnc.html index.html index.htm;
}
location /websockify {
proxy_connect_timeout 7d;
proxy_send_timeout 7d;
proxy_read_timeout 7d;
proxy_http_version 1.1;
proxy_pass http://localhost:9001/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location ~ /\. {
deny all;
}
}
}
运行容器
1
docker run --name=coolq -it -d --restart=always -p 88:9000 -v /data/cooclq/coolq-data:/home/user/coolq -v /data/coolq/coolq-data/nginx.conf:/etc/nginx/nginx.conf -e VNC_PASSWD="123456" -e COOLQ_ACCOUNT="1234567" coolq/wine-coolq
输入IP加88端口访问:密码就输入123456
然后登陆小号QQ进行测试
二,通过docker-compose.yml一键启动
1 | mkdir /data/coolq/coolq-data/ -p && cd /data/coolq/ && mkdir ./ssl/certs/wohenliu.com/ -p |
把上面的nginx.conf文件拷贝到/data/coolq/目录下
编辑 vim docker-compose.yml 文件
1 | vim docker-compose.yml |
然后执行命令
1 | docker-compose up -d |
最后配置域名ssl访问,编辑nginx.conf文件
1 | 增加 |
改好了后就重启容器
然后登陆小号QQ进行测试
- 本文标题:docke一键安装酷Q搭建个人QQ机器人
- 本文作者:yichen
- 本文链接:https://yc6.cool/2020/08/04/docker一键安装酷Q搭建个人QQ机器人/
- 版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明出处!