From 37f845429b35b9c33f0257b7147e2d9170ba509d Mon Sep 17 00:00:00 2001 From: Hendrik Kleinwaechter Date: Thu, 2 Mar 2023 17:19:02 -0500 Subject: [PATCH] Add Dockerfile This adds a Dockerfile to run the project. All you need to do now is run `make` in the root folder and the pdf will be built. --- Dockerfile | 15 +++++++++++++++ README.md | 44 ++++++++++++++++++++++++++++++++++++++------ book/latexmkrc | 5 ----- makefile | 11 +++++++++++ 4 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 Dockerfile delete mode 100644 book/latexmkrc create mode 100644 makefile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f3a9869 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +# Dockerfile.rails +FROM ghcr.io/xu-cheng/texlive-full + +WORKDIR /root + +RUN apk add make zip tidyhtml +RUN wget https://archive.org/download/kindlegen_linux_2_6_i386_v2_9/kindlegen_linux_2.6_i386_v2_9.tar.gz +RUN tar xzf kindlegen_linux_2.6_i386_v2_9.tar.gz +RUN mv kindlegen /usr/bin + +WORKDIR /opt/the-sourdough-framework + +COPY . . + +CMD ["/bin/sh"] diff --git a/README.md b/README.md index 7f4e7d7..b4f9bfa 100644 --- a/README.md +++ b/README.md @@ -23,19 +23,49 @@ as possible are provided. ![The book cover](cover.jpg) -## Building the book +## Building the book (Docker) + +```console +make +``` + +Then you can check out the file `book/book.pdf` + +If you want to build the eBook versions (.epub, .mobi, .azw3) run: + +```console +make release +``` + +You can check the files in the folder `book/release/` + +## Building the book locally (LaTeX) Make sure you have `biber` installed. Refer to your system's installation -instructions. Also make sure you have `pdflatex` installed. +instructions for LaTeX. ```console cd book/ make ``` -## Compiled version +If you want to build the eBook versions (.epub, .mobi, .azw3) run: -You can [download the compiled PDF version here](https://www.the-bread-code.io/book.pdf). +```console +cd book/ +make release +``` + +You can check the files in the folder `book/release/` + +## Compiled versions + +The below versions are automatically built on every push to the `main` branch. + +* [Download compiled .pdf version](https://www.the-bread-code.io/book.pdf) +* [Download compiled .epub version](https://www.the-bread-code.io/book.epub) +* [Download compiled .mobi version](https://www.the-bread-code.io/book.mobi) +* [Download compiled .azw3 version](https://www.the-bread-code.io/book.azw3) ## Support @@ -47,8 +77,10 @@ That's why I decided to open source my knowledge hoping that it will reach more people all over the world without budget constraints. -If you would like to contribute financially -to the project you can do so via my [ko-fi page.](https://breadco.de/book) +If you would like to contribute with a small donation you can do so +via my [ko-fi page.](https://breadco.de/book). This will help me +to cover costs related to running the-bread-code and allow me +to work more updates for this book. ## Links diff --git a/book/latexmkrc b/book/latexmkrc deleted file mode 100644 index dd76b82..0000000 --- a/book/latexmkrc +++ /dev/null @@ -1,5 +0,0 @@ -END{ -# system("tex4ebook -j output -m draft -a debug main > tex4ebook.log"); -system("tex4ebook -j output -e build.mk4 main"); -system("rm tikz-cache/*"); -} diff --git a/makefile b/makefile new file mode 100644 index 0000000..dc2fa92 --- /dev/null +++ b/makefile @@ -0,0 +1,11 @@ +.PHONY: build_book +build_book: build_docker_image + docker run -it -v $(PWD):/opt/repo the-sourdough-framework /bin/bash -c "cd /opt/repo/book && make build_pdf" + +.PHONY: release +release: build_docker_image + docker run -it -v $(PWD):/opt/repo the-sourdough-framework /bin/bash -c "cd /opt/repo/book && make build_pdf" + +.PHONY: build_docker_image +build_docker_image: + docker build -t the-sourdough-framework -f Dockerfile .