File size: 1,283 Bytes
bc5458f 2029332 d32b726 2029332 e634aec 2029332 b2b95bd 2029332 b2b95bd 2029332 b2b95bd d4ec69a 303bec6 b2b95bd d736ec4 2029332 b2b95bd 94d9c2b 2029332 e634aec 3528eef 2029332 b2b95bd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | FROM python:3.12.8
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV HF_HOME=/app/.huggingface_cache
# Create directories for the Hugging Face cache, VectorDB, models and logs
RUN mkdir -p /app/.huggingface_cache /app/VectorDB /app/models /app/logs
# Install dependencies including wget for downloading model files
RUN apt-get update && apt-get install -y \
python3-pip \
python3-dev \
libatlas-base-dev \
wget \
&& pip install --no-cache-dir --upgrade pip
# Download the ONNX model file and voices file (adjust URLs if necessary)
RUN wget -O /app/models/kokoro-v1.0.fp16.onnx https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files-v1.0/kokoro-v1.0.fp16.onnx \
&& wget -O /app/models/voices-v1.0.bin https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files-v1.0/voices-v1.0.bin
# Set the working directory in the container
WORKDIR /app
# Copy and install Python dependencies
COPY requirements.txt .
RUN pip install -r requirements.txt
# Copy the current directory contents into the container
COPY . /app/
# Set appropriate permissions for the cache, vectorstore, models and logs directories
RUN chmod -R 777 /app
# Expose the port the app runs on
EXPOSE 7860
# Run the application
CMD ["python", "app.py"]
|