Skip to content

Commit f58f03c

Browse files
committed
fix(deploy): align Dockerfile with Hugging Face non-root UID 1000 spec and correct Space URL
1 parent e095efc commit f58f03c

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/huggingface.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ jobs:
1919
run: |
2020
git config --global user.email "actions@github.com"
2121
git config --global user.name "GitHub Actions"
22-
# Replace 'urstark/editguardian' with your exact Hugging Face Space name if different
23-
git remote add space https://urstark:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/urstark/editguardian
22+
git remote add space https://urstark:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/urstark/GuardianBot
2423
git push --force space HEAD:main

Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
FROM python:3.10-slim
22

3+
# Create non-root user with UID 1000 to comply with Hugging Face Spaces security constraints
4+
RUN useradd -m -u 1000 user
5+
USER user
6+
ENV PATH="/home/user/.local/bin:$PATH"
7+
38
WORKDIR /app
49

5-
COPY requirements.txt .
6-
RUN pip install --no-cache-dir -r requirements.txt
10+
COPY --chown=user ./requirements.txt requirements.txt
11+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
712

8-
COPY . .
13+
COPY --chown=user . /app
914

1015
EXPOSE 7860
1116

12-
CMD ["python", "editguardian/main.py"]
17+
CMD ["python", "Guardian/main.py"]

0 commit comments

Comments
 (0)