Yan Bai
commited on
Commit
·
1f42eea
1
Parent(s):
55e1701
update
Browse files- Dockerfile +6 -2
Dockerfile
CHANGED
|
@@ -10,9 +10,13 @@ RUN pip install --no-cache-dir \
|
|
| 10 |
# 添加 Megatron-LM core_v0.12.2
|
| 11 |
RUN git clone -b core_v0.12.2 --depth 1 https://github.com/NVIDIA/Megatron-LM.git /opt/Megatron-LM
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
# 复制代码至工作目录
|
| 14 |
-
WORKDIR /app
|
| 15 |
-
COPY . /app
|
| 16 |
|
| 17 |
# HF Spaces 默认通过 $PORT 注入端口
|
| 18 |
ENV PYTHONPATH=/opt/Megatron-LM:$PYTHONPATH
|
|
|
|
| 10 |
# 添加 Megatron-LM core_v0.12.2
|
| 11 |
RUN git clone -b core_v0.12.2 --depth 1 https://github.com/NVIDIA/Megatron-LM.git /opt/Megatron-LM
|
| 12 |
|
| 13 |
+
# 创建与 HF Spaces 运行时一致的 uid=1000 用户,避免 getpwuid() 错误
|
| 14 |
+
RUN groupadd -g 1000 user && \
|
| 15 |
+
useradd -m -u 1000 -g user user || true
|
| 16 |
+
|
| 17 |
# 复制代码至工作目录
|
| 18 |
+
WORKDIR $HOME/app
|
| 19 |
+
COPY --chown=user . $HOME/app
|
| 20 |
|
| 21 |
# HF Spaces 默认通过 $PORT 注入端口
|
| 22 |
ENV PYTHONPATH=/opt/Megatron-LM:$PYTHONPATH
|