Spaces:
Sleeping
Sleeping
File size: 648 Bytes
09426f2 |
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 |
FROM python:3.10-slim
# Create a new user - myuser
RUN useradd -ms /bin/bash myuser
# Switch to that user
USER myuser
# Create a .cache directory for Hugging Face transformers
# This is necessary to avoid permission issues when running the container as a non-root user,
# especially when using Hugging Face libraries.
# The directory will be used to store cached files, models, etc.
# The permissions are set to allow read/write access for the user.
RUN mkdir -p /home/myuser/.cache && chmod -R 755 /home/myuser/.cache
ADD requirements.txt .
RUN pip install -r requirements.txt
ADD my_server.py .
EXPOSE 8000
CMD ["python", "my_server.py"]
|