FROM python:3.9 WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Create cache directory and set permissions RUN mkdir -p /app/cache && chmod -R 777 /app/cache # Set Hugging Face cache directory ENV HF_HOME=/app/cache # Pre-download the model to avoid runtime download issues RUN python -c "from transformers import AutoTokenizer, AutoModelForMaskedLM; AutoTokenizer.from_pretrained('microsoft/codebert-base-mlm'); AutoModelForMaskedLM.from_pretrained('microsoft/codebert-base-mlm')" COPY . . EXPOSE 8501 CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]