FROM openlistteam/openlist:latest USER root RUN mkdir -p /opt/openlist/data && chown -R 1001:1001 /opt/openlist/data # 安装 socat 用于端口转发,curl 用于健康检查 RUN apk add --no-cache socat curl # 健康检查 HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ CMD curl -f http://localhost:7860/ || exit 1 EXPOSE 7860 # OpenList 默认监听 5244,socat 将 7860 转发到 5244 CMD ["sh", "-c", "./openlist server --no-prefix & sleep 2 && socat TCP-LISTEN:7860,fork,reuseaddr TCP:127.0.0.1:5244"]