99i commited on
Commit
bdcc094
·
verified ·
1 Parent(s): 1321f0d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +38 -1
Dockerfile CHANGED
@@ -1 +1,38 @@
1
- FROM lscr.io/linuxserver/msedge:latest
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ---------- 1. 基础镜像 ----------
2
+ FROM ubuntu:22.04
3
+
4
+ # ---------- 2. 环境变量 ----------
5
+ # 避免交互式 tzdata 安装
6
+ ENV DEBIAN_FRONTEND=noninteractive
7
+ # Chromium 远程调试端口
8
+ ENV CHROME_PORT=9222
9
+
10
+ # ---------- 3. 安装 Chromium 与中文字体 ----------
11
+ RUN apt-get update && \
12
+ apt-get install -y --no-install-recommends \
13
+ chromium-browser \
14
+ fonts-wqy-zenhei \
15
+ fonts-wqy-microhei && \
16
+ apt-get clean && \
17
+ rm -rf /var/lib/apt/lists/*
18
+
19
+ # ---------- 4. 启动脚本 ----------
20
+ # 让 Chromium 以 headless 模式启动,监听所有网卡,开放远程调试端口
21
+ COPY <<EOF /usr/local/bin/start-chrome.sh
22
+ #!/bin/bash
23
+ exec chromium-browser \
24
+ --headless \
25
+ --disable-gpu \
26
+ --disable-dev-shm-usage \
27
+ --no-sandbox \
28
+ --remote-debugging-address=0.0.0.0 \
29
+ --remote-debugging-port=\${CHROME_PORT:-9222} \
30
+ "\$@"
31
+ EOF
32
+ RUN chmod +x /usr/local/bin/start-chrome.sh
33
+
34
+ # ---------- 5. 暴露端口 ----------
35
+ EXPOSE 9222
36
+
37
+ # ---------- 6. 默认启动命令 ----------
38
+ CMD ["/usr/local/bin/start-chrome.sh"]