Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) <[email protected]>"
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
Loading