kemayo / leech

Turn a story on certain websites into an ebook for convenient reading
MIT License
154 stars 24 forks source link

Add Dockerfile #62

Closed atamis closed 3 years ago

atamis commented 3 years ago

I suspect that this project does not really need a Dockerfile, but as someone who does not use Python frequently, I did not want to install poetry and my usual solution is Docker containers. I'm also not very familiar with poetry, so building a Dockerfile that suited my needs (leech as the bare entrypoint, could be run in any directory, not just the project directory) was surprisingly difficult. Running the project from poetry shell was not possible in a Docker container. poetry run made it impossible to change the current working directory. I also had a lot of trouble getting pillow working fully until I looked up its package list in its documentation. So I figured I'd offer my work to the project.

I didn't set up any CI because I think only the maintainer can do that.

kemayo commented 3 years ago

It feels a bit circuitous to install poetry just to export the dependencies for pip. Perhaps instead you could do

RUN poetry config virtualenvs.create false
RUN poetry install --no-dev

That'd keep all the installing happening via poetry, thus not potentially confusing the issue with an install mechanism I'm not going to be testing regularly. The virtualenvs.create false line would make poetry just install things to the global environment inside the container.

(Obviously, I'm essentially using the poetry-created virtualenv as the container for my own usage.)

atamis commented 3 years ago

That leaves Poetry installed in the final container, but given how many other dependencies we install, it probably didn't matter.

kemayo commented 3 years ago

Sorry, got sidetracked by work and forgot I hadn't merged this.