Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +31 -0
Dockerfile
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use the official Python 3.11 slim image as the base
|
2 |
+
FROM python:3.11-slim
|
3 |
+
|
4 |
+
# Set environment variables
|
5 |
+
ENV PATH="/root/.local/bin:$PATH"
|
6 |
+
|
7 |
+
# Install system dependencies
|
8 |
+
RUN apt-get update && \
|
9 |
+
apt-get install -y --no-install-recommends \
|
10 |
+
ffmpeg \
|
11 |
+
espeak-ng \
|
12 |
+
wget && \
|
13 |
+
apt-get clean && \
|
14 |
+
rm -rf /var/lib/apt/lists/*
|
15 |
+
|
16 |
+
# Install Audiblez
|
17 |
+
RUN pip install --no-cache-dir audiblez
|
18 |
+
|
19 |
+
# Download Kokoro model and voices
|
20 |
+
RUN wget https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files/kokoro-v0_19.onnx -P /root/.local/share/audiblez/ && \
|
21 |
+
wget https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files/voices.json -P /root/.local/share/audiblez/
|
22 |
+
|
23 |
+
# Set the working directory
|
24 |
+
WORKDIR /ebooks
|
25 |
+
|
26 |
+
# Create the /m4b directory
|
27 |
+
RUN mkdir -p /m4b
|
28 |
+
|
29 |
+
# Convert all .epub files in the /ebooks directory to audiobooks using the af_sky voice
|
30 |
+
# and move the resulting .m4b files to the /m4b directory
|
31 |
+
CMD for book in *.epub; do audiblez "$book" -v af_sky; done && cp *.m4b /m4b/
|