Skip to content

Commit

Permalink
feat: Added info about the used weasyprint docker-image version (#40)
Browse files Browse the repository at this point in the history
* feat: Added info about the used weasyprint docker-image version

Refs: #104

* feat: Added info about the used weasyprint docker-image version

Refs: #104
  • Loading branch information
pbezliapovich authored Jul 31, 2024
1 parent 293d9a8 commit ad27a7a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM python:3.12.4-slim@sha256:740d94a19218c8dd584b92f804b1158f85b0d241e5215ea26ed2dcade2b9d138
LABEL maintainer="Team Polarion (CLEW/WZU/POLARION) <polarion@sbb.ch>"
ARG APP_VERSION

RUN apt-get update && \
apt-get --yes --no-install-recommends install python3-cffi python3-brotli libpango-1.0-0 libpangoft2-1.0-0 fonts-liberation chromium && \
Expand All @@ -9,6 +10,7 @@ RUN apt-get update && \

ENV WORKING_DIR=/opt/weasyprint
ENV CHROME_EXECUTABLE_PATH=/usr/bin/chromium
ENV WEASYPRINT_SERVICE_VERSION=$APP_VERSION

WORKDIR ${WORKING_DIR}

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Service providing REST API to use WeasyPrint functionality

```bash
docker build \
--build-arg APP_VERSION=62.3.0 \
--file Dockerfile \
--tag weasyprint-service:62.3.0 .
```
Expand Down
4 changes: 3 additions & 1 deletion app/WeasyprintController.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import os
import platform
from urllib.parse import unquote

Expand All @@ -15,7 +16,8 @@
def version():
return {
"python": platform.python_version(),
"weasyprint": weasyprint.__version__
"weasyprint": weasyprint.__version__,
"weasyprintServiceVersion": os.environ.get('WEASYPRINT_SERVICE_VERSION')
}


Expand Down

0 comments on commit ad27a7a

Please sign in to comment.