Skip to content

Commit

Permalink
fix: svg images bottom part is missing
Browse files Browse the repository at this point in the history
Refs: #63
  • Loading branch information
Jumas committed Sep 11, 2024
1 parent b2a4126 commit e92672d
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 7 deletions.
56 changes: 52 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,58 @@ LABEL maintainer="SBB Polarion Team <polarion-opensource@sbb.ch>"
ARG APP_IMAGE_VERSION

RUN apt-get update && \
apt-get --yes --no-install-recommends install chromium fonts-dejavu fonts-liberation libpango-1.0-0 libpangoft2-1.0-0 python3-brotli python3-cffi && \
apt-get clean autoclean && \
apt-get --yes autoremove && \
rm -rf /var/lib/apt/lists/*
apt-get --no-install-recommends --yes install fonts-dejavu fonts-liberation libpango-1.0-0 libpangoft2-1.0-0 python3-brotli python3-cffi

# Chromium dependencies
RUN apt-get --no-install-recommends --yes install \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libatomic1 \
libatspi2.0-0 \
libcairo2 \
libcups2 \
libdav1d6 \
libdbus-1-3 \
libdouble-conversion3 \
libevent-2.1-7 \
libflac12 \
libgbm1 \
libglib2.0-0 \
libgtk-3-0 \
libharfbuzz-subset0 \
libjpeg62-turbo \
libjsoncpp25 \
liblcms2-2 \
libminizip1 \
libnss3 \
libopenh264-7 \
libopenjp2-7 \
libopus0 \
libpulse0 \
libsnappy1v5 \
libwoff1 \
libx11-xcb1 \
libxdamage1 \
libxkbcommon0 \
libxslt1.1 \
libxnvctrl0 \
wget \
x11-utils \
xdg-utils

Check notice

Code scanning / SonarCloud

Arguments in long RUN instructions should be sorted Low

Sort these package names alphanumerically. See more on SonarCloud

# Download Chromium (urls taken from http://snapshot.debian.org/archive/debian/20240820T082737Z/pool/main/c/chromium/)
RUN wget http://snapshot.debian.org/archive/debian/20240820T082737Z/pool/main/c/chromium/chromium_126.0.6478.182-1~deb12u1_amd64.deb && \
wget http://snapshot.debian.org/archive/debian/20240825T022815Z/pool/main/c/chromium/chromium-common_126.0.6478.182-1~deb12u1_amd64.deb

# Install the downloaded packages
# DO NOT USE """|| apt-get install -f -y""" COZ THIS CAN FORCE TO UPDATE CHROMIUM TO THE LATEST VERSION
RUN dpkg -i chromium-common_126.0.6478.182-1~deb12u1_amd64.deb && dpkg -i chromium_126.0.6478.182-1~deb12u1_amd64.deb

# Clean up to reduce image size
RUN apt-get -y autoremove && \
apt-get -y clean && \
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*

ENV WORKING_DIR=/opt/weasyprint
ENV CHROME_EXECUTABLE_PATH=/usr/bin/chromium
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Service providing REST API to use WeasyPrint functionality

```bash
docker build \
--build-arg APP_IMAGE_VERSION=62.4.0 \
--build-arg APP_IMAGE_VERSION=62.4.3 \
--file Dockerfile \
--tag weasyprint-service:62.4.0 .
--tag weasyprint-service:62.4.3 .
```

## Start Docker container
Expand All @@ -16,7 +16,7 @@ Service providing REST API to use WeasyPrint functionality
docker run --detach \
--publish 9080:9080 \
--name weasyprint-service \
weasyprint-service:62.4.0
weasyprint-service:62.4.3
```

## Stop Docker container
Expand Down

0 comments on commit e92672d

Please sign in to comment.