![]() ![]() This is where all the python packages and dependencies are installed. ![]() The build stage is nearly identical to the earlier Dockerfile (except the CMD instruction is now in the run stage). ![]() Let’s see this with a two-stage Dockerfile: a build stage using the same python base image as before, followed by a run stage using a much smaller python image. This is where a multi-stage Dockerfile becomes a better alternative. The image calibreweb-run is 1.06GB, hardly a surprise given that the base image itself is 921MB. Ĭalibreweb-run latest d3b4e56b43c1 7 seconds ago 1.06GB Now let’s build the image and check its size: > docker build -t calibreweb-run. I also assigned the ENV variable PYTHONDONTWRITEBYTECODE to prevent python from writing out pyc files, and PYTHONUNBUFFERED to prevent buffering stdin/stdout. The code is simple enough: it pulls the latest stable python image available as of now, creates a working directory /app and a python virtual environment in the container, appends the bin folder of venv to the start of the path (which is what activating venv does), copies requirements.txt from host to container, installs packages and dependencies, and runs the executable cps (from /app/.venv/bin). RUN pip install -no-cache-dir -r requirements.txt # install packages (including dependencies) # create virtual environment (inside container) # set working directory (inside container) First a simple Dockerfile that has just one stage: it starts with one base image and creates one final image. The benefit of requirements.txt is that the versions of these packages and all dependencies are frozen, which makes the docker image stable against future package upgrades, and also portable so everyone will install the same versions. > pipenv run pip freeze > requirements.txtĪ requirements.txt file is strictly not necessary instead one can directly install the two packages with Dockerfile. In the first step, I created a working directory ~/Documents/CalibreWeb, moved into it, and installed the two packages calibreweb and jsonschema ( jsonschema is optional and needed for syncing with Kobo ereader) using pipenv in a python virtual environment to generate the requirements.txt file, with the following commands on a terminal: > mkdir ~/Documents/CalibreWeb You may instead prefer installing docker desktop that offers a simpler interface. I prefer working with terminals, and use docker CLI (command line interface) on a linux platform. To follow along, you need Docker installed on your machine. Besides, working with docker is always a good practice. The main reason for this exercise is that it is possible to greatly reduce the image size by using a multi-stage Dockerfile. Here I’ll describe how to build your own docker image for Calibre-web. This is especially true because a pre-built docker image is already available, and a good how-to on running it on your machine. I have used both, and on balance find docker to be easier to deploy. This can be achieved with either a virtual environment or a docker container. Recently I came across the web app Calibre-web, which offers a great online alternative along with a polished UI for online ebook management.Ĭalibre-web is python-based, and like most python applications, should be installed in an isolated environment to avoid issues with pre-existing dependencies. I am not a fan of the former, and haven’t found an easy sync method with the latter. Standard choices are to either 1) physically hook up your ereader to the computer where Calibre is installed, or 2) access Calibre server or a similar service over your local network. Do I need virtual hosts package? Q3.Those like me who use Calibre to manage their ereader library are familiar with the hassle of syncing between the two. ProxyPass ProxyPassReverse ProxyPassReverseCookiePath / /calibre-web/ RequestHeader set X-SCRIPT-NAME /calibre-web SSLCertificateKeyFile "C:\Apache24\conf\ssl\test.key" SSLCertificateFile "C:\Apache24\conf\ssl\test.crt" SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL Here I found an example of Apache Reverse proxy for Calibre-Web Listen 443 Note: I also tried to point the ReverseProxy to MyNethserverIP but I still have the same result. While HTTP://MyNethserverIP:8083 keeps working well. The requested URL /calibre was not found on this server. yes I point to 127.0.0.1 since I use host as network.īut HTTP://MyNethserverIP/calibre return Error 404 Not Found.My goal is to access MyNethserverIP/calibre and/or myDomain.tld/calibre which I believe it is possible with the ReverseProxy module. So I run linuxserver/calibre-web via docker which I could access on the port :8083 since I opened this port and the container run with the network host (I know it is not the best). Module: Webserver with virtual hosts and reverse proxy ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |