Spaces:
Paused
Paused
File size: 1,051 Bytes
1d5f5a4 e2e89ab 1d5f5a4 4b22329 1d5f5a4 b1c9d0a 29e7707 b1c9d0a 29e7707 b1c9d0a 29e7707 1d5f5a4 ce2e827 40b2574 c830c4f 3712219 ce2e827 40b2574 e2e89ab 29e7707 ce2e827 1d5f5a4 b1c9d0a |
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 40 41 |
# 使用官方Ubuntu基础镜像
FROM ubuntu:22.04
EXPOSE 5244
# 设置时区
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone
# 安装系统依赖
RUN apt-get update && \
apt-get install -y wget tar python3 python3-pip && \
rm -rf /var/lib/apt/lists/*
# 安装huggingface_hub
RUN pip3 install --no-cache-dir huggingface_hub
# 设置工作目录
WORKDIR /OpenList
# 下载并解压 OpenList
RUN wget -q https://github.com/OpenListTeam/OpenList/releases/download/beta/openlist-linux-amd64.tar.gz && \
tar -xzf openlist-linux-amd64.tar.gz && \
find . -type f -name "openlist" -exec mv {} . \; && \
rm -rf openlist-linux-amd64.tar.gz *linux-amd64*
# 创建数据目录并设置权限
RUN mkdir -p /OpenList/data && \
chmod -R 777 /OpenList/data
# 设置可执行权限
RUN chmod 755 openlist
# 设置非root用户运行
RUN useradd -m openlistuser && \
chown -R openlistuser:openlistuser /OpenList
USER openlistuser
# 启动服务
CMD ["./openlist", "server"] |