Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +26 -11
Dockerfile
CHANGED
|
@@ -1,16 +1,31 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
RUN
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
-
|
| 12 |
|
| 13 |
-
|
| 14 |
-
RUN
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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"]
|