mmonax commited on
Commit
d8ea664
·
verified ·
1 Parent(s): 6a6ed1c

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -19
Dockerfile CHANGED
@@ -5,7 +5,7 @@ WORKDIR /app
5
  ENV DEBIAN_FRONTEND=noninteractive
6
  ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=true
7
 
8
- # Install system dependencies
9
  RUN apt-get update && apt-get install -y \
10
  xvfb \
11
  x11vnc \
@@ -20,32 +20,19 @@ RUN apt-get update && apt-get install -y \
20
  libdbus-glib-1-2 \
21
  python3 \
22
  build-essential \
23
- fonts-noto-cjk \
24
  && rm -rf /var/lib/apt/lists/*
25
 
26
- # Copy dependency files and install
27
  COPY package.json pnpm-lock.yaml ./
28
  COPY scripts/ ./scripts/
29
  COPY patches/ ./patches/
30
  RUN npm install -g pnpm && pnpm install --frozen-lockfile
31
 
32
- # Copy source and initialize browsers
33
  COPY . .
34
  RUN npm run init
35
 
36
- EXPOSE 7860
37
 
38
- # Create startup script
39
- RUN printf '#!/bin/bash\n\
40
- Xvfb :99 -screen 0 1280x720x24 &\n\
41
- sleep 2\n\
42
- VNC_PASS="${VNC_PASSWORD:-vncpass}"\n\
43
- mkdir -p ~/.vnc\n\
44
- x11vnc -storepasswd "$VNC_PASS" ~/.vnc/passwd 2>/dev/null\n\
45
- x11vnc -display :99 -rfbport 5900 -passwdfile ~/.vnc/passwd -forever -bg 2>/dev/null &\n\
46
- export DISPLAY=:99\n\
47
- export PORT=7860\n\
48
- echo "Starting WebAI2API on port 7860..."\n\
49
- npm start -- -login\n' > /app/start.sh && chmod +x /app/start.sh
50
-
51
- CMD ["/app/start.sh"]
 
5
  ENV DEBIAN_FRONTEND=noninteractive
6
  ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=true
7
 
8
+ # 1. 安装系统依赖
9
  RUN apt-get update && apt-get install -y \
10
  xvfb \
11
  x11vnc \
 
20
  libdbus-glib-1-2 \
21
  python3 \
22
  build-essential \
 
23
  && rm -rf /var/lib/apt/lists/*
24
 
25
+ # 2. 复制依赖文件、脚本和补丁目录,然后安装
26
  COPY package.json pnpm-lock.yaml ./
27
  COPY scripts/ ./scripts/
28
  COPY patches/ ./patches/
29
  RUN npm install -g pnpm && pnpm install --frozen-lockfile
30
 
31
+ # 3. 复制源码并初始化
32
  COPY . .
33
  RUN npm run init
34
 
35
+ EXPOSE 3000 5900
36
 
37
+ # 4. 启动服务(配置文件会自动从 config.example.yaml 复制到 data/config.yaml)
38
+ CMD ["npm", "start", "--", "-xvfb", "-vnc"]