data / Dockerfile
flzta's picture
Update Dockerfile
87e4496 verified
raw
history blame
1.12 kB
FROM alpine:latest
WORKDIR /opt/cloudreve
ENV TZ=Asia/Shanghai
# 下载 Cloudreve 3.8.3
RUN apk update && \
apk add --no-cache wget unzip python3 py3-pip bash tar gzip jq curl && \
rm -rf /var/cache/apk/*
# 创建 Cloudreve 数据目录
RUN mkdir -p /opt/cloudreve/data
RUN wget -O cloudreve.tar.gz "https://github.com/cloudreve/Cloudreve/releases/download/3.8.3/cloudreve_3.8.3_linux_amd64.tar.gz" && \
tar -zxvf cloudreve.tar.gz && \
rm cloudreve.tar.gz
# 创建虚拟环境 (可选, 但推荐)
RUN python3 -m venv /opt/venv
ENV VIRTUAL_ENV=/opt/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# 安装 huggingface_hub
RUN pip install --no-cache-dir huggingface_hub
# 复制同步脚本
COPY sync_data.sh /opt/cloudreve/
# 设置同步脚本执行权限
RUN chmod +x /opt/cloudreve/sync_data.sh
# **确保 /opt/cloudreve 目录及其内容有读写执行权限**
RUN chmod -R 777 /opt/cloudreve/
# 暴露 Cloudreve 端口
EXPOSE 5212
# 设置启动命令 to run Cloudreve in foreground and sync script in background
CMD /opt/cloudreve/cloudreve -c /opt/cloudreve/config.ini & /opt/cloudreve/sync_data.sh