# Use the official Speaches CPU image as the base FROM ghcr.io/speaches-ai/speaches:latest-cpu # Reconfigure the internal Uvicorn server to Hugging Face's expected port ENV PORT=7860 ENV UVICORN_PORT=7860 EXPOSE 7860 # Redirect Hugging Face cache directory to a persistent/writable location ENV HF_HOME=/data/.cache/huggingface # Switch to root to configure permissions USER root # Create the data directory and set ownership to Hugging Face's runtime user RUN mkdir -p /data/.cache/huggingface && \ chown -R 1000:1000 /data # Revert to Hugging Face's required user space execution USER 1000 # Do NOT override CMD or ENTRYPOINT. The base image automatically spins up the server.