Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +5 -1
Dockerfile
CHANGED
@@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -y \
|
|
21 |
FROM python:3.10-slim
|
22 |
|
23 |
# 设置工作目录
|
24 |
-
WORKDIR /
|
25 |
|
26 |
# 从构建阶段复制必要的文件
|
27 |
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
|
@@ -30,6 +30,10 @@ COPY . .
|
|
30 |
|
31 |
# 设置环境变量
|
32 |
ENV PYTHONUNBUFFERED=1
|
|
|
|
|
|
|
|
|
33 |
|
34 |
# 暴露 Flask 端口
|
35 |
EXPOSE 5000
|
|
|
21 |
FROM python:3.10-slim
|
22 |
|
23 |
# 设置工作目录
|
24 |
+
WORKDIR /tmp
|
25 |
|
26 |
# 从构建阶段复制必要的文件
|
27 |
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
|
|
|
30 |
|
31 |
# 设置环境变量
|
32 |
ENV PYTHONUNBUFFERED=1
|
33 |
+
ENV MPLCONFIGDIR=/tmp/matplotlib
|
34 |
+
|
35 |
+
# 确保Matplotlib配置目录可写
|
36 |
+
RUN mkdir -p /tmp/matplotlib && chmod -R 777 /tmp/matplotlib
|
37 |
|
38 |
# 暴露 Flask 端口
|
39 |
EXPOSE 5000
|