sub2api / Dockerfile
Story19240's picture
Update Dockerfile
b78a63e verified
Raw
History Blame Contribute Delete
507 Bytes
# 拉取最新镜像
FROM weishaw/sub2api:latest
# 指定端口
ENV PORT=7860
EXPOSE 7860
# 临时切换到 root 用户来修改文件权限
USER root
# 强行给应用所在的工作目录(通常是 /app 或 /data)赋予读写权限
# 这样 sub2api 就能顺利写入数据库和配置文件了
RUN chmod -R 777 /app 2>/dev/null || true
RUN chmod -R 777 /data 2>/dev/null || true
RUN chmod -R 777 /workspace 2>/dev/null || true
# 切换回 Hugging Face 强制要求的 1000 普通用户
USER 1000