Spaces:
Sleeping
Sleeping
File size: 819 Bytes
af2b875 36a7fa8 af2b875 36a7fa8 af2b875 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
FROM python:3.11
# Create user with UID 1000 (Hugging Face requirement)
RUN useradd -m -u 1000 user
# Set environment variables for the non-root user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Set working directory (creates /home/user/app automatically)
WORKDIR $HOME/app
# (Optional) If you want to disable pip caching entirely, you can skip creating the cache directory.
# Otherwise, you could fix its permissions—but here we opt to disable caching.
RUN mkdir -p $HOME/.cache
# Adjust ownership/permissions for the app directory (and /usr if needed)
RUN chown -R 1000:0 $HOME/app $HOME/.cache /usr && \
chmod -R 777 $HOME/app /usr $HOME/.cache
COPY . $HOME/app
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 7860
CMD ["python", "-m", "bot"] |