Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +13 -9
Dockerfile
CHANGED
@@ -2,30 +2,34 @@
|
|
2 |
FROM python:3.11-slim
|
3 |
|
4 |
# Set environment variables
|
5 |
-
ENV
|
|
|
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 |
-
#
|
17 |
-
RUN
|
|
|
|
|
18 |
|
19 |
# Download Kokoro model and voices
|
20 |
-
RUN
|
|
|
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 |
-
#
|
30 |
-
|
31 |
-
CMD for book in *.epub; do audiblez "$book" -v af_sky; done && cp *.m4b /m4b/
|
|
|
2 |
FROM python:3.11-slim
|
3 |
|
4 |
# Set environment variables
|
5 |
+
ENV VENV_PATH="/venv"
|
6 |
+
ENV PATH="$VENV_PATH/bin:$PATH"
|
7 |
|
8 |
# Install system dependencies
|
9 |
RUN apt-get update && \
|
10 |
apt-get install -y --no-install-recommends \
|
11 |
ffmpeg \
|
12 |
espeak-ng \
|
13 |
+
wget \
|
14 |
+
python3-venv && \
|
15 |
apt-get clean && \
|
16 |
rm -rf /var/lib/apt/lists/*
|
17 |
|
18 |
+
# Create and activate virtual environment, then install audiblez
|
19 |
+
RUN python -m venv $VENV_PATH && \
|
20 |
+
$VENV_PATH/bin/pip install --no-cache-dir --upgrade pip && \
|
21 |
+
$VENV_PATH/bin/pip install --no-cache-dir audiblez
|
22 |
|
23 |
# Download Kokoro model and voices
|
24 |
+
RUN mkdir -p /root/.local/share/audiblez/ && \
|
25 |
+
wget https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files/kokoro-v0_19.onnx -P /root/.local/share/audiblez/ && \
|
26 |
wget https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files/voices.json -P /root/.local/share/audiblez/
|
27 |
|
28 |
+
# Set the working directory to /ebooks
|
29 |
WORKDIR /ebooks
|
30 |
|
31 |
# Create the /m4b directory
|
32 |
RUN mkdir -p /m4b
|
33 |
|
34 |
+
# Copy all .m4b output to /m4b after conversion using audiblez from venv
|
35 |
+
CMD for book in *.epub; do $VENV_PATH/bin/audiblez "$book" -v af_aoede; done && cp *.m4b /m4b/
|
|