zerolin1024 commited on
Commit
c49b2bc
·
verified ·
1 Parent(s): 93920b9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -11
Dockerfile CHANGED
@@ -1,16 +1,31 @@
1
- FROM python:3.11
2
 
3
- WORKDIR /code
 
4
 
5
- COPY ./requirements.txt /code/requirements.txt
6
- RUN python3 -m pip install --no-cache-dir --upgrade pip
7
- RUN python3 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
8
 
9
- COPY . .
 
10
 
11
- CMD ["panel", "serve", "/code/app.py", "--address", "0.0.0.0", "--port", "7860", "--allow-websocket-origin", "*"]
12
 
13
- RUN mkdir /.cache
14
- RUN chmod 777 /.cache
15
- RUN mkdir .chroma
16
- RUN chmod 777 .chroma
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM alpine AS builder
2
 
3
+ # 安装构建和运行所需的依赖
4
+ RUN apk add --no-cache nodejs npm git curl jq python3 python3-dev py3-pip
5
 
6
+ # 创建非 root 用户
7
+ RUN adduser -D app
8
+ USER app
9
+ WORKDIR /home/app
10
 
11
+ # 修正:使用 'git clone' 命令
12
+ RUN git clone https://github.com/Linli1221/casikosa.git casikosa
13
 
14
+ WORKDIR /home/app/casikosa
15
 
16
+ # 安装 Node.js 依赖并构建
17
+ RUN npm ci --omit dev && npm run download-dist
18
+
19
+ # 设置并激活 Python 虚拟环境
20
+ ENV VIRTUAL_ENV=/home/app/venv
21
+ RUN python3 -m venv $VIRTUAL_ENV
22
+ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
23
+
24
+ # 安装 Python 依赖
25
+ RUN pip install --no-cache-dir requests webdavclient3
26
+
27
+ # 修正:删除这一行多余且错误的 COPY 指令
28
+ # COPY --chown=app:app /home/app/casikosa/
29
+
30
+ EXPOSE 3001
31
+ CMD ["/bin/sh", "-c", "sleep 30 && node server/server.js"]