====== Stirling PDF ======
[[https://github.com/Stirling-Tools/Stirling-PDF|Stirling PDF]] is an amazing collection of on-line tools to edit, cut, rotate and edit PDF files. Being able to self-host it is amazing and a must-have.
===== Installation =====
Stirling-PDF can be installed on bare-metal, but the list of dependencies is so thick and complex that this is one of those situations where a container is highly recomended.
So first of all, as usual, create the dedicated user:
useradd -d /data/daemons/stirlingpdf -m stirlingpdf
and, as user **stirlingpdf**, create the **/data/daemons/stirlingpdf/docker-compose.yml** file:
version: '3.3'
services:
stirling-pdf:
image: frooodle/s-pdf:latest
ports:
- '8089:8080'
volumes:
- /data/daemons/stirlingpdf/trainingData:/usr/share/tessdata #Required for extra OCR languages
- /data/daemons/stirlingpdf/extraConfigs:/configs
# - /location/of/customFiles:/customFiles/
# - /location/of/logs:/logs/
environment:
- DOCKER_ENABLE_SECURITY=false
- INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false
- LANGS=en_GB
- SYSTEM_ROOTURIPATH=/stirlingpdf
network:
- stirlingpdf-net
networks:
stirlingpdf-net: {}
Adapt the paths and the port to your needs (8089).
Now pull it:
su - stirlingpdf
podman compose pull
===== Reverse Proxy =====
The following NGINX configuration file is the base for Stirling-PDF:
location /stirlingpdf/ {
proxy_pass http://127.0.0.1:8089;
access_log off;
client_max_body_size 200M;
proxy_read_timeout 3600;
}
Adapt the port to match the one in the docker compose. I also suggest to set a proper //client_max_body_size// to allow upload/download of big enough files, and also the //proxy_read_timeout// value.
See [[selfhost:nginx|The Reverse Proxy concept]]
===== Autostart =====
To start it, and set it up on boot, as usual follow my indications [[gentoo:containers|Using Containers on Gentoo]], so link the **user-containers** init script:
ln -s /etc/init.d/user-containers /etc/init.d/user-containers.stirlingpdf
and create the following config file:
USER=stirlingpdf
DESCRIPTION="The PDF manager server"
Add the service to the default runlevel and start it now:
rc-update add user-containers.stirlingpdf default
rc-service user-containers.stirlingpdf start