API Service to generate PDF from HTML using Python + WeasyPrint
Original Dockerfile from weasyprint-docker-alpine
Python 3 https://www.python.org/downloads/
WeasyPrint Installation Guild https://doc.courtbouillon.org/weasyprint/stable/first_steps.html#installation
Run the docker image, exposing port 5001
$ docker build -t pdf-generator-api:latest .
$ docker run -p 5001:5001 pdf-generator-api:latest
$ pip install virtualenv
$ python -m venv venv
$ venv\Scripts\activate
$ pip install -r requirements.txt
$ sudo apt install python3-venv
$ python3 -m venv venv
$ source ./venv/bin/activate
$ python3 -m pip install -r requirements.txt
# Output a list of installed packages into a requirements file (requirements.txt):
$ pip freeze > requirements.txt
# Edit requirements.txt, and replace all "==" with ">=". Use the "Replace All" command in the editor.
# Upgrade all outdated packages:
$ pip install -r requirements.txt --upgrade