In Docker
, it is very convenient to have a base image that you can use to deploy all your applications.
Here we provide an example of a fairly complete Dockerfile
with the following details:
imagemagick
for image manipulationwkhtmltopdf
for creating PDF reportsqpdf
for manipulating and concatenating PDFslibreoffice
for converting docx, etc., to PDF for viewingemail2pdf
to convert eml files to PDF for viewingKernel
parameter configuration for file monitoringLocale and timezone
configuration for Spain and UTF-8FROM node:20-bullseye-slim
RUN <<EOF
apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update
apt-get install -y --allow-unauthenticated \
tzdata \
locales \
nano \
libfontenc1 \
xfonts-75dpi \
xfonts-base \
xfonts-encodings \
xfonts-utils \
openssl \
build-essential \
libssl-dev \
libxrender-dev \
git-core \
libx11-dev \
libxext-dev \
libfontconfig1-dev \
libfreetype6-dev \
fontconfig \
rsync \
libicu67 \
wget \
qpdf \
libreoffice \
pip \
python3-magic \
imagemagick
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.bullseye_amd64.deb
dpkg -i wkhtmltox_0.12.6.1-2.bullseye_amd64.deb
rm wkhtmltox_0.12.6.1-2.bullseye_amd64.deb
cd / && git clone https://github.com/Corvus4n6/email2pdf2.git && cd /email2pdf2 && pip install .
ln -fs /usr/share/zoneinfo/Europe/Madrid /etc/localtime
echo "fs.inotify.max_user_instances=524288" >> /etc/sysctl.conf
echo "fs.inotify.max_user_watches=524288" >> /etc/sysctl.conf
echo "fs.inotify.max_queued_events=524288" >> /etc/sysctl.conf
echo "es_ES.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen
apt-get clean -y
apt-get autoclean -y
apt-get autoremove
EOF
ENV LANG="es_ES.UTF-8"
ENV LANGUAGE="es_ES:es"
ENV LC_ALL="es_ES.UTF-8"
ENV TZ="Europe/Madrid"
This image is publicly available on Docker Hub.
To create your own image, edit your Dockerfile
as needed and create the base image with the command docker build --no-cache -t <your-image-name> .
.
Please note, browse Issues and Discussions in Github for more information