Skip to content

Conversation

@astappiev
Copy link

This PR adds a Dockerfile for easier installation.

Usage

Build the Docker image:

docker build -t dpsprep .

Run the container with a volume mount to process files:

docker run --rm -u $(id -u):$(id -g) -v $(pwd):/files dpsprep input.djvu output.pdf

To use specific options:

docker run --rm -u $(id -u):$(id -g) -v $(pwd):/files dpsprep --pool=8 --quality=50 input.djvu output.pdf

@v--
Copy link
Collaborator

v-- commented Apr 13, 2025

I have several comments:

  1. I appreciate your contribution and I hope you are willing to maintain the Dockerfile in the future.
  2. Please add a corresponding section to the readme. The description of this pull request seems more than sufficient.
  3. There is no need to use Python 3.9; Using a more modern Python versions is more future-proof (i.e. will require less maintenance on your side).
  4. I Removing the apt package lists manually seems a bit weird to me. All I seem to find are old issues on GitHub regarding Debian in Docker. Are you sure that this is still the suggested approach?

PS: CLI tools are not exactly what Docker was created for, so I assume you had difficulties installing the package. Is that so? Or do you simply prefer running your tools in Docker containers?

@astappiev
Copy link
Author

Yes, I wasn't able to install djvulibre-python on Ubuntu 24.04 (WSL), due to PackageVersionError: cannot determine DjVuLibre version error on poetry install.

And in general, for most of the one-time required tools, I would prefer to use a container compared to installing all dependencies and dealing with Python environments. Also, the README says it doesn't run on Windows, so this can be a workaround for such cases.

  1. I hope I have gotten rid of all the djvu files that I had, but if needed, tag me, and I will update.
  2. Added.
  3. Updated to 3.11, on 3.12 there are extra warning messages printed.
  4. Not fancy, but it's more or less standard practice to reduce image size, e.g. https://docs.docker.com/build/building/best-practices/#sort-multi-line-arguments.

@v--
Copy link
Collaborator

v-- commented Apr 14, 2025

Yes, I wasn't able to install djvulibre-python on Ubuntu 24.04 (WSL)

This is what you should have started with. Otherwise I can only guess what motivated the pull request.

Modulo DjVuLibre, this project uses pure Python dependencies to avoid problems. If you have DjVuLibre installed (in WSL), a dependency problem can be considered a bug. For the next release (whenever that is), I will try to add some more notes in the README regarding dependencies and troubleshooting.

Updated to 3.11, on 3.12 there are extra warning messages printed.

Okay then; I will leave the pull request open until somebody debugs this. Ubuntu 24.04 works fine in GitHub Actions, so an Ubuntu image may be a better choice than a Debian image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants