remote-team-clock / Dockerfile
duqing2026's picture
Fix: PermissionError on HF Spaces by creating user/dirs in Dockerfile
df118ab
raw
history blame contribute delete
375 Bytes
FROM python:3.9-slim
WORKDIR /app
# Create a non-root user first
RUN useradd -m -u 1000 user
# Copy files with correct ownership
COPY --chown=user . /app
# Install dependencies
RUN pip install --no-cache-dir flask gunicorn
# Switch to non-root user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]