File size: 689 Bytes
618da39
 
96cd66a
cbc9320
618da39
cbc9320
618da39
b4c3ab1
cbc9320
618da39
4f5ee19
618da39
 
e510c89
cbc9320
618da39
 
bcedbf0
cbc9320
618da39
96cd66a
cbc9320
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 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.