Skip to content

Instantly share code, notes, and snippets.

@ManotLuijiu
Last active June 29, 2024 16:04
Show Gist options
  • Save ManotLuijiu/ea33a9ceb411d7cc758fd55e6ae96e3c to your computer and use it in GitHub Desktop.
Save ManotLuijiu/ea33a9ceb411d7cc758fd55e6ae96e3c to your computer and use it in GitHub Desktop.
How to install Stirling PDF on Docker using docker-compose
version: '3.3'
services:
stirling-pdf:
image: frooodle/s-pdf:latest
ports:
- '8080:8080'
volumes:
- ./trainingData:/usr/share/tessdata #Required for extra OCR languages
- ./extraConfigs:/configs
- ./customFiles:/customFiles/
- ./logs:/logs/
environment:
- DOCKER_ENABLE_SECURITY=true
- SECURITY_ENABLELOGIN=true
- SECURITY_INITIALLOGIN_USERNAME=admin
- SECURITY_INITIALLOGIN_PASSWORD=yourpassword
- INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false
- LANGS=th_TH
- UI_APP_NAME=Put any name here
- UI_HOME_DESCRIPTION=Your locally hosted one-stop-shop for all your PDF needs.
- UI_APP_NAVBAR_NAME=Stirling PDF
restart: always
server {
# replace example.com with your domain name
# Don't forget to add domain name
# and your server's IP in DNS Server like AWS/Route53
server_name example.com;
listen 80;
listen [::]:80;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location = /live/websocket {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
}
@ManotLuijiu
Copy link
Author

ManotLuijiu commented Jun 29, 2024

How to enable SSL (HTTPS) for Stirling PDF

Go to /etc/nginx/sites-available/ or using this command

sudo nano /etc/nginx/sites-available/stirlingpdf

Copy code from stirlingpdf as shown above and paste to it.

Sync sites-available/stirlingpdf to sites-enabled/stirlingpdf using this command

sudo ln -s /etc/nginx/sites-available/stirlingpdf /etc/nginx/sites-enabled/

Run Certbot

sudo certbot --nginx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment