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

build: include verovio via python in docker image #19

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
16 changes: 6 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ARG PRINCE_VERSION=15.1
ARG SAXON_VERSION=SaxonHE11-5
ARG TARGETARCH
ARG UBUNTU_VERSION=22.04
ARG VEROVIO_VERSION=3.15.0
ARG XERCES_VERSION=25.1.0.1
ARG DEB_FILE=prince_${PRINCE_VERSION}-1_ubuntu${UBUNTU_VERSION}_${TARGETARCH}.deb

Expand All @@ -20,7 +21,6 @@ ENV ANT_VERSION=1.10.13

ENV ANT_HOME=/opt/apache-ant-${ANT_VERSION}
ENV PATH=${PATH}:${ANT_HOME}/bin
ENV NODE_ENV=production

USER root

Expand All @@ -31,14 +31,10 @@ RUN apt-get update && \
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc && \
echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
# install packages
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils temurin-${JAVA_VERSION}-jdk curl unzip git libc6 aptitude libaom-dev gdebi fonts-stix && \
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils temurin-${JAVA_VERSION}-jdk curl unzip git build-essential python3-pip python3-dev swig libc6 aptitude libaom-dev gdebi fonts-stix && \
# install prince
curl --proto '=https' --tlsv1.2 -O https://www.princexml.com/download/${DEB_FILE} && \
gdebi --non-interactive ./${DEB_FILE} && \
# install nodejs
curl -fsSL https://deb.nodesource.com/setup_18.x -o nodesource_setup.sh && \
bash nodesource_setup.sh && \
apt install nodejs && \
# link ca-certificates
ln -sf /etc/ssl/certs/ca-certificates.crt /usr/lib/prince/etc/curl-ca-bundle.crt

Expand All @@ -56,10 +52,10 @@ ADD https://www.oxygenxml.com/maven/com/oxygenxml/oxygen-patched-xerces/${XERCES
# cleanup
RUN apt-get purge -y aptitude apt-utils gdebi curl unzip wget apt-transport-https && \
apt-get autoremove -y && apt-get clean && \
rm ${DEB_FILE} nodesource_setup.sh && \
rm ${DEB_FILE} && \
rm -r /tmp

# setup node app for rendering MEI files to SVG using Verovio Toolkit
# setup verovio via python
WORKDIR /opt/docker-mei
COPY ["index.js", "package.json", "package-lock.json*", "./"]
RUN npm install --production
RUN python3 -m pip install --upgrade pip && \
python3 -m pip install verovio==${VEROVIO_VERSION}