Skip to content

Manual Docker Guide

Drew Thomasson edited this page Dec 19, 2025 · 5 revisions

Running the pre-built Docker Container

Available pre-build tags: cpu

-Run with CPU only

docker run --pull always --rm -p 7860:7860 athomasson2/ebook2audiobook:cpu

This command will start the Gradio interface on port 7860.(localhost:7860)

  • For more options add the parameter --help

Building the Docker Container

Important

Check out the Build Arguments .

  • You can manually build the docker image with the command:
docker build -t athomasson2/ebook2audiobook .

Docker Build Arguments

Edit: IF GPU isn't detected then you'll have to build the image with Compose or Manual

Docker Build Arguments (GPU Options)

GPU Options -> --build-arg TORCH_VERSION=cuda118 Available tags: [cuda121, cuda118, cuda128, rocm, xpu, cpu]

All CUDA version numbers should work, Ex: CUDA 11.6-> cuda116

--build-arg SKIP_XTTS_TEST=true (Saves space by not baking XTTSv2 model into docker image)

Docker headless guide

Important

For simpler headless setup use the Compose.

  • Before you do run this you need to create a dir named "input-folder" in your current dir which will be linked, This is where you can put your input files for the docker image to see
mkdir input-folder && mkdir Audiobooks
  • In the command below swap out YOUR_INPUT_FILE.TXT with the name of your input file
docker run --pull always --rm \
    -v $(pwd)/input-folder:/app/input_folder \
    -v $(pwd)/audiobooks:/app/audiobooks \
    athomasson2/ebook2audiobook:cpu \
    --headless --ebook /input_folder/YOUR_EBOOK_FILE
  • The output Audiobooks will be found in the Audiobook folder which will also be located in your local dir you ran this docker command in

To get the help command for the other parameters this program has you can run this

docker run --pull always --rm athomasson2/ebook2audiobook:cpu --help

That will output this Help command output

Docker container file locations

All ebook2audiobooks will have the base dir of /app/ For example: tmp = /app/tmp audiobooks = /app/audiobooks

Common Docker Issues

  • My NVIDIA GPU isnt being detected?? -> GPU ISSUES Wiki Page

  • python: can't open file '/home/user/app/app.py': [Errno 2] No such file or directory (Just remove all post arguments as I replaced the CMD with ENTRYPOINT in the Dockerfile)

    • Example: docker run --pull always athomasson2/ebook2audiobook:cpu app.py --script_mode full_docker - > corrected - > docker run --pull always athomasson2/ebook2audiobook:cpu
    • Arguments can be easily added like this now docker run --pull always athomasson2/ebook2audiobook:cpu --share
  • Docker gets stuck downloading Fine-Tuned models. (This does not happen for every computer but some appear to run into this issue) Disabling the progress bar appears to fix the issue, as discussed here in #191 Example of adding this fix in the docker run command

docker run --pull always --rm --gpus all -e HF_HUB_DISABLE_PROGRESS_BARS=1 -e HF_HUB_ENABLE_HF_TRANSFER=0 \
    -p 7860:7860 athomasson2/ebook2audiobook:cpu