build: 添加无头浏览器dockerfile
This commit is contained in:
parent
1495ac516b
commit
c0cfacbd33
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# 基于 chromedp/headless-shell 基础镜像
|
||||||
|
FROM chromedp/headless-shell:latest
|
||||||
|
|
||||||
|
# 安装 Noto 和 Noto CJK 字体
|
||||||
|
RUN sed -i 's@http://deb.debian.org@http://mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources \
|
||||||
|
&& apt-get update -y \
|
||||||
|
&& apt-get install -y fonts-noto fonts-noto-cjk \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/
|
@ -8,5 +8,6 @@ go build
|
|||||||
|
|
||||||
# run
|
# run
|
||||||
```shell
|
```shell
|
||||||
|
sudo docker-compose up --build -d
|
||||||
./qq_bot
|
./qq_bot
|
||||||
```
|
```
|
||||||
|
13
docker-compose.yml
Normal file
13
docker-compose.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
services:
|
||||||
|
headless-shell:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
ports:
|
||||||
|
- "9222:9222"
|
||||||
|
command: >
|
||||||
|
--disable-gpu
|
||||||
|
--no-sandbox
|
||||||
|
--remote-debugging-address=0.0.0.0
|
||||||
|
--remote-debugging-port=9222
|
||||||
|
restart: unless-stopped
|
Loading…
x
Reference in New Issue
Block a user