[docker] Adds Docker support

- Built on top of @lesensei's work with minor changes
This commit is contained in:
Nemo 2020-06-09 18:41:29 +05:30
parent 376041d909
commit c4624342d3
3 changed files with 27 additions and 1 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
out/
html/
*.html

23
Dockerfile Normal file
View File

@ -0,0 +1,23 @@
FROM pandoc/latex:latest
WORKDIR /src
# RUN apk add bash git go jq qpdf
ADD https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip /src/pup.zip
ADD https://kindlegen.s3.amazonaws.com/kindlegen_linux_2.6_i386_v2_9.tar.gz /src/kindlegen/kindlegen.tar.gz
RUN unzip pup.zip && \
mv pup /usr/bin && \
rm pup.zip && \
cd kindlegen && \
tar zxf kindlegen.tar.gz && \
mv kindlegen /usr/bin && \
cd .. && \
rm -rf kindlegen && \
apk add --no-cache bash jq qpdf
COPY cover.pdf cover.jpg generate.sh /src/
VOLUME /src/out
ENTRYPOINT ["/src/generate.sh"]

View File

@ -5,7 +5,7 @@ Generates ebooks for The Ickabog by J.K Rowling. Original text from https://www.
## Dependencies:
- `wget`
- [`pup`](https://github.com/ericchiang/pup)
- [`pup`](https://github.com/ericchiang/pup) and `jq` to parse input files
- [`pandoc`](https://pandoc.org/) to generate EPUB and PDF files
- `qpdf` to add cover to PDF files. (optional)
- `kindlegen` or `calibre` installed to generate MOBI files. (optional)