File size: 1,262 Bytes
7887777
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM eclipse-temurin:8-jre-focal

# ---------- 基础工具 ----------
RUN apt-get update && apt-get install -y --no-install-recommends \
    unzip \
    curl wget \
    procps \
    socat \
    ca-certificates \
  && rm -rf /var/lib/apt/lists/*

# ---------- 准备目录 ----------
RUN mkdir -p /webos && \
    chmod 755 /webos

WORKDIR /webos

# ---------- 下载安装包 ----------
# 说明:如果该 URL 返回 php 源码/403,就说明它需要鉴权/不可直链。
# 那时你应该把 webos.zip 放到仓库里(或私密拉取),并把下面换成 COPY webos.zip /webos/webos.zip
RUN wget --no-check-certificate -nv \
    "https://support.tenfell.cn/webos_update/php/index.php?type=8&m=1" \
    -O /webos/webos.zip \
    && unzip -o /webos/webos.zip -d /webos/ \
    && rm -f /webos/webos.zip

# 让 api 目录的启动脚本可见/可执行(按你原逻辑)
RUN if [ -f /webos/api/restart.sh ]; then chmod +x /webos/api/restart.sh; fi

# ---------- HF 需要非 root uid=1000 能写 ----------
RUN useradd -m -u 1000 appuser || true
RUN chown -R 1000:1000 /webos
USER 1000
WORKDIR /webos/api

# ---------- 启动入口 ----------
COPY --chown=1000:1000 entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]