KaiWu commited on
Commit
11a5220
·
1 Parent(s): 587ef78

fix(deploy): 容器以 root 运行以获得 HF 持久化卷 /data 的写权限

Browse files

- Dockerfile 增加 USER root,绕过 mambaorg/micromamba 默认用户 $MAMBA_USER
对挂载卷无写权限的问题,修复 PermissionError: '/data/outputs'
- HF Spaces 容器本身已沙箱隔离,MVP 阶段 root 运行可接受

Files changed (1) hide show
  1. Dockerfile +4 -0
Dockerfile CHANGED
@@ -7,6 +7,10 @@ RUN micromamba create -y -f /tmp/environment.yml && micromamba clean --all --yes
7
 
8
  COPY --chown=$MAMBA_USER:$MAMBA_USER . /app
9
 
 
 
 
 
10
  ENV AIGC_ARTIFACT_ROOT=/data/outputs
11
  ENV GRADIO_SERVER_NAME=0.0.0.0
12
  ENV GRADIO_SERVER_PORT=7860
 
7
 
8
  COPY --chown=$MAMBA_USER:$MAMBA_USER . /app
9
 
10
+ # Run as root to avoid PermissionError on HF Spaces persistent volumes
11
+ # (mounted /data is owned by root; switching USER before app start is the simplest fix).
12
+ USER root
13
+
14
  ENV AIGC_ARTIFACT_ROOT=/data/outputs
15
  ENV GRADIO_SERVER_NAME=0.0.0.0
16
  ENV GRADIO_SERVER_PORT=7860