Spaces:
Running
Running
Update Dockerfile
Browse files18 unmodified lines192021222324252627282930313233343536373818 unmodified lines# Copy the rest of the application code into the containerCOPY . .# ---- ADD THIS LINE ----# Set environment variables for Hugging Face cache directories# Use directories within /app where the user has write permissions.ENV HF_HOME=/app/.cache/huggingfaceENV HF_DATASETS_CACHE=/app/.cache/datasets# Alternatively, just HF_DATASETS_CACHE might be enough if only datasets are used.# Using HF_HOME covers models, datasets, etc.# ---- END OF ADDED LINE ----# Expose the port the app runs on# This informs Docker that the container listens on this portEXPOSE 7860# Define the command to run the application# Use 0.0.0.0 to listen on all network interfaces inside the container# Uvicorn will listen on the port defined by the $PORT env var (7860)CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]18 unmodified lines19202122232425262728293031323318 unmodified lines# Copy the rest of the application code into the containerCOPY . .# Explicitly create cache dir and set open permissions during buildRUN mkdir -p /app/.cache && chmod -R 777 /app/.cache# Set environment variables for Hugging Face cache directoriesENV HF_HOME=/app/.cache/huggingfaceENV HF_DATASETS_CACHE=/app/.cache/datasets# Expose the port the app runs onEXPOSE 7860# Define the command to run the applicationCMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
Dockerfile+3-8