fix: run Docker image as root for data volume compatibility

Revert the non-root container user so existing deployments with
root-owned data volumes keep working without a manual chown step.
This commit is contained in:
vastsa committed 2026-07-23 22:35:00 +08:00
1 parent 24bf6e1a81
commit fc0cbeb4f0
3 files changed
+6 -14

No files matched your search

+1 -8
View File
@@ -63,14 +63,7 @@ RUN apt-get update \
&& apt-get upgrade -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --no-cache-dir -r requirements.txt \
&& pip cache purge || true \
&& groupadd --system --gid 1000 appuser \
&& useradd --system --uid 1000 --gid appuser --create-home --home-dir /home/appuser --shell /usr/sbin/nologin appuser \
&& mkdir -p /app/data \
&& chown -R appuser:appuser /app
# 非 root 运行,降低容器逃逸后的主机影响面
USER appuser
&& pip cache purge || true
# 环境变量配置
ENV HOST="0.0.0.0" \