flzta commited on
Commit
21e066f
·
verified ·
1 Parent(s): c4f3936

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +46 -0
Dockerfile ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM alpine:latest
2
+
3
+ WORKDIR /opt/cloudreve
4
+
5
+ ENV TZ=Asia/Shanghai
6
+
7
+ # 安装必要的依赖
8
+ RUN apk update && apk add --no-cache wget tar gzip python3 py3-pip curl bash git make g++ build-base
9
+
10
+ # 创建 Python 虚拟环境并安装 huggingface_hub
11
+ ENV VIRTUAL_ENV=/opt/venv
12
+ RUN python3 -m venv $VIRTUAL_ENV
13
+ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
14
+ RUN pip install --no-cache-dir huggingface_hub
15
+
16
+ # 下载 Cloudreve 3.8.3 预构建二进制文件
17
+ RUN wget https://github.com/cloudreve/Cloudreve/releases/download/3.8.3/cloudreve_3.8.3_linux_amd64.tar.gz
18
+
19
+ # 解压 Cloudreve
20
+ RUN tar -zxvf cloudreve_3.8.3_linux_amd64.tar.gz
21
+
22
+ # 创建数据目录
23
+ RUN mkdir -p /opt/cloudreve/data
24
+ RUN chmod -R 755 /opt/cloudreve
25
+ RUN chown -R www-data:www-data /opt/cloudreve
26
+
27
+ # 将用户 www-data 添加到已存在的组
28
+ RUN adduser -u 1000 -D -S -G www-data www-data
29
+
30
+ # 复制同步脚本
31
+ COPY sync_data.sh /
32
+ RUN chmod +x /sync_data.sh
33
+ RUN chown www-data:www-data /sync_data.sh
34
+
35
+ USER www-data
36
+ WORKDIR /opt/cloudreve
37
+
38
+ ENV NODE_ENV=production
39
+ ENV HOST=0.0.0.0
40
+ # ENV ENABLE_AUTH=1 # 如果需要认证,可以启用
41
+ # ENV SERVER_SECRET=your-secret-key # 设置您的密钥
42
+ # ENV SERVER_PASS=your-password # 设置您的密码
43
+
44
+ EXPOSE 5212
45
+
46
+ CMD ["/sync_data.sh"]