Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files12345678910111213141516171819202122FROM python:3.9-slim# Set working directoryWORKDIR /app# Install dependenciesCOPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txt# Set writable cache directoryENV TRANSFORMERS_CACHE=/app/cacheENV HF_HOME=/app/cacheRUN mkdir -p /app/cache# Copy all filesCOPY . .# Expose port for StreamlitEXPOSE 7860# Run the appCMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]12345678910111213141516171819202122232425262728293031FROM python:3.9-slim# Create a non-root userRUN useradd -m appuser# Set environment variables for Hugging Face cacheENV TRANSFORMERS_CACHE=/app/cacheENV HF_HOME=/app/cache# Set working directoryWORKDIR /app# Copy requirements and install themCOPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txt# Create cache directory and set permissionsRUN mkdir -p /app/cache && chown -R appuser /app/cache# Copy all files and set ownershipCOPY . .RUN chown -R appuser /app# Switch to non-root userUSER appuser# Expose port for StreamlitEXPOSE 7860# Run the Streamlit appCMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
Dockerfile+16-7