Spaces:
Sleeping
Sleeping
dockerfile
Browse files1234567891011121314151617181920212223242526FROM python:3.9-slim# Set working directoryWORKDIR /app# Copy dependenciesCOPY requirements.txt ./# Install dependenciesRUN pip install --no-cache-dir -r requirements.txt# Hugging Face cache directoryENV HF_HOME=/app/.cacheRUN mkdir -p /app/.cache && chmod -R 777 /app/.cache# Pre-download model to cacheRUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')"# Copy rest of the projectCOPY . .# Expose the port expected by HF SpacesEXPOSE 8080# Run appCMD ["python", "app.py"]1234567891011121314151617181920212223FROM python:3.9-slimWORKDIR /app# Copy requirements + setup.pyCOPY requirements.txt setup.py ./# dependenciesRUN pip install --no-cache-dir -r requirements.txt# Hugging Face cacheENV HF_HOME=/app/.cacheRUN mkdir -p /app/.cache && chmod -R 777 /app/.cache# Pre-download modelRUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')"COPY . .# Expose port Hugging FaceEXPOSE 8080CMD ["python", "app.py"]
Dockerfile+6-9