Spaces:
Sleeping
Sleeping
File size: 655 Bytes
4743672 b832177 4743672 b832177 4743672 b832177 4743672 b832177 4743672 |
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 28 29 30 31 32 |
FROM python:3.10-slim
# Create a non-root user (UID 1000)
RUN useradd -m -u 1000 user
# Set the working directory
WORKDIR /app
# Copy all files into /app
COPY . /app
# (Optional) Adjust permissions
RUN chown -R user:user /app
RUN chmod -R 777 /app
# Switch to non-root user
USER user
# Set environment variables
ENV HF_HOME=/app/.cache \
HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Expose the port for Hugging Face Spaces
EXPOSE 7860
# Run Chainlit when the container starts
CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]
|