diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..acfa272 --- /dev/null +++ b/Containerfile @@ -0,0 +1,14 @@ +# +# Build: podman build -t xword-dl . +# podman tag xword-dl:latest xword-dl:$(git describe --tags) +# +# Run: podman run --rm --tz local -v $HOME/my-xwords:/xw:Z xword-dl [...] +# +FROM docker.io/library/alpine:latest +WORKDIR /xw +COPY . /xword-dl +RUN apk update && \ + apk add python3 py3-setuptools py3-pip gcc python3-dev musl-dev libxml2 libxslt libxml2-dev libxslt-dev && \ + python3 -m pip install /xword-dl && \ + apk del gcc python3-dev musl-dev libxslt-dev libxml2-dev +ENTRYPOINT ["/usr/bin/xword-dl"] diff --git a/README.md b/README.md index 6ffe3a5..15e48e0 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,15 @@ in the downloaded directory may be enough. But in either case, you probably want to install `xword-dl` and its dependencies in a dedicated virtual environment. I use `virtualenv` and `virtualenvwrapper` personally, but that's a matter of preference. If you're already feeling overwhelmed by the thought of managing Python packages, know you're not alone. The [official documentation is pretty good](https://packaging.python.org/tutorials/installing-packages/), but it's a hard problem, and it's not just you. If it's any consolation, learning how to use virtual environments today on something sort of frivolous like a crossword puzzle downloader will probably save you from serious headaches in the future when the stakes are higher. +Alternatively, if you have the [podman](https://podman.io/) container engine installed, you can build and run `xword-dl` in a container image: + +``` +podman build -t xword-dl . [slow; only needs to be run once per release] +podman tag xword-dl:latest xword-dl:$(git describe --tags) [optional] +... +podman run --rm --tz local -v $HOME/my-xwords:/xw:Z xword-dl [...] +``` + ## Usage Once installed, you can invoke `xword-dl`, providing the short code of the site from which to download. If you run `xword-dl` without providing a site keyword, it will print some usage instructions and then exit. diff --git a/requirements.txt b/requirements.txt index b2f22a9..683f5ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,4 @@ Unidecode==1.3.6 pyyaml==6.0.1 xmltodict==0.13.0 lxml==4.9.2 +tzlocal==2.1