Skip to content
Draft
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
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FROM ghcr.io/foliant-docs/foliant/foliant:slim
# TODO: uncomment
# FROM ghcr.io/foliant-docs/foliant/foliant:slim
FROM docker.io/foliant/foliant:slim

RUN pip3 install foliantcontrib.init
107 changes: 59 additions & 48 deletions Dockerfile-full
Original file line number Diff line number Diff line change
@@ -1,61 +1,62 @@
FROM ghcr.io/foliant-docs/foliant/foliant:pandoc

RUN apt update

RUN apt install --reinstall ca-certificates
# TODO: uncomment
# FROM ghcr.io/foliant-docs/foliant/foliant:pandoc
FROM docker.io/foliant/foliant:pandoc

RUN apt update \
&& apt install --reinstall ca-certificates \
&& apt install -y \
# Needed for ImageMagick
inkscape \
# Needed for Puppeteer
libasound2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY ./dependency_files/ /usr/src/app/dependency_files/

# Needed for ImageMagick
RUN apt install -y inkscape

RUN rm -rf /etc/ImageMagick-6/policy.xml \
&& cp /usr/src/app/dependency_files/imagemagick/policy.xml /etc/ImageMagick-6/

# Needed for Puppeteer
RUN apt install -y libasound2

RUN wget -q -O - https://deb.nodesource.com/setup_18.x | bash
# RUN wget -q -O - https://deb.nodesource.com/setup_20.x | bash

RUN apt install -y nodejs
# TODO: comment the next block and uncomment previous one
# Uncomment on the next line and comment on the previous one if your region has problems accessing deb.nodesource.com
RUN curl -fsSL https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-x64.tar.xz -o node.tar.xz && \
tar -xJf node.tar.xz -C /usr/local --strip-components=1 && \
rm node.tar.xz

RUN npm install -g puppeteer
ENV PATH=/usr/local/bin:$PATH

# Needed for BPMN preprocessor

RUN npm install -g [email protected] --unsafe-perm

# Needed for Argdown preprocessor

RUN npm install -g @argdown/cli
RUN npm install -g @argdown/image-export --unsafe-perm
RUN npm install -g puppeteer \
# Needed for BPMN preprocessor
&& npm install -g [email protected] --unsafe-perm \
# Needed for Argdown preprocessor
&& npm install -g @argdown/cli \
&& npm install -g @argdown/image-export --unsafe-perm

#######################
# Databases for DBDoc #
#######################

# MS SQL Server
RUN apt-get install -y unixodbc-dev
RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN wget -O /etc/apt/sources.list.d/mssql-release.list https://packages.microsoft.com/config/ubuntu/20.04/prod.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql17
RUN apt-get update && \
apt-get install -y curl gnupg && \
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
apt-get update && \
ACCEPT_EULA=Y apt-get install -y msodbcsql17

# MySQL
RUN apt-get install -y mysql-server libmysqlclient-dev

#######################

RUN npm install -g widdershins

RUN npm install -g mermaid \
&& npm install -g mermaid.cli --unsafe-perm=true --allow-root

RUN npm install -g aglio --unsafe-perm=true --allow-root

RUN npm install -g md-to-pdf --unsafe-perm=true --allow-root

RUN npm install -g raml2html raml2html-full-markdown-theme
RUN npm install -g widdershins \
mermaid \
&& npm install -g mermaid.cli --unsafe-perm=true --allow-root \
&& npm install -g aglio --unsafe-perm=true --allow-root \
&& npm install -g md-to-pdf --unsafe-perm=true --allow-root \
&& npm install -g raml2html raml2html-full-markdown-theme

RUN mkdir -p /usr/src/app/dependency_files/slate/ \
&& cd /usr/src/app/dependency_files/slate/ \
Expand All @@ -66,18 +67,28 @@ RUN mkdir -p /usr/src/app/dependency_files/slate/ \
&& bundle install

# Needed for Confluence backend
RUN apt install -y libkrb5-dev

RUN apt install -y graphviz libgraphviz-dev

RUN apt install -y plantuml && wget -O /usr/share/plantuml/plantuml.jar http://sourceforge.net/projects/plantuml/files/plantuml.jar/download

RUN pip3 install --upgrade pip

RUN cd /usr/src/app/dependency_files/python_packages/ \
RUN apt install -y \
libkrb5-dev \
graphviz \
libgraphviz-dev \
plantuml \
&& wget -O /usr/share/plantuml/plantuml.jar http://sourceforge.net/projects/plantuml/files/plantuml.jar/download \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

ENV PLANTUML_LIMIT_SIZE=100000

# RUN apt install -y \
# python3-dev \
# build-essential \
# libjpeg-dev \
# zlib1g-dev \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/*

RUN pip3 install --upgrade pip \
&& cd /usr/src/app/dependency_files/python_packages/ \
&& pip3 install -r ./requirements.txt \
&& pip3 install --no-compile -r ./requirements_no_compile.txt

ENV PLANTUML_LIMIT_SIZE 100000

WORKDIR /usr/src/app/
28 changes: 26 additions & 2 deletions Dockerfile-pandoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
FROM ghcr.io/foliant-docs/foliant/foliant
# TODO: uncomment
# FROM ghcr.io/foliant-docs/foliant/foliant:latest
FROM docker.io/foliant/foliant:latest

ENV DEBIAN_FRONTEND noninteractive
# RUN apt-get update && \
# apt-get install -y \
# wget \
# texlive-full \
# texlive-latex-extra \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/*

# RUN tlmgr update --self && \
# tlmgr install tocstyle && \
# mktexlsr

# RUN apt-get update && apt-get install -y \
# python3.11 \
# python3-pip \
# texlive-latex-base \
# texlive-latex-extra \
# texlive-fonts-recommended \
# texlive-fonts-extra \
# texlive-lang-cyrillic \
# texlive-science \
# && rm -rf /var/lib/apt/lists/*
RUN apt update && apt install -y wget texlive-full librsvg2-bin

RUN wget https://github.com/jgm/pandoc/releases/download/3.1.12.2/pandoc-3.1.12.2-1-amd64.deb && dpkg -i pandoc-3.1.12.2-1-amd64.deb
RUN pip3 install foliantcontrib.pandoc
39 changes: 34 additions & 5 deletions Dockerfile-slim
Original file line number Diff line number Diff line change
@@ -1,14 +1,43 @@
FROM ubuntu:focal
FROM ubuntu:20.04

LABEL authors="Konstantin Molchanov <[email protected]>"

ARG VERSION
ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && apt install -y git python3 python3-pip
RUN pip3 install foliant>=$VERSION
RUN apt-get update \
&& apt-get install -y \
curl \
git \
python3.9 \
python3-pip \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN apt install -y locales && locale-gen en_US.UTF-8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
# RUN python3 -m venv /opt/venv
# ENV PATH="/opt/venv/bin:$PATH"

RUN pip3 install poetry==2.1.1

# TODO: make install from PyPi
RUN git clone -b add-partial-copy https://github.com/foliant-docs/foliant.git \
&& cd foliant \
&& poetry build --format=wheel \
&& pip3 install dist/*.whl

RUN apt-get update \
&& apt-get install -y locales \
&& sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
&& locale-gen en_US.UTF-8 \
&& update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

ENTRYPOINT [ "foliant" ]
CMD []
17 changes: 9 additions & 8 deletions build_full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ else
fi

if [ ! $1 ] ; then
FOLIANT_VERSION=`curl https://raw.githubusercontent.com/foliant-docs/foliant/master/foliant/__init__.py | grep -${grep_option}o "\d+\.\d+\.\d+"`
# TODO: switch add-partial-copy to master
FOLIANT_VERSION=`curl https://raw.githubusercontent.com/foliant-docs/foliant/add-partial-copy/foliant/__init__.py | grep -${grep_option}o "\d+\.\d+\.\d+"`
else
FOLIANT_VERSION=$1
fi
Expand All @@ -21,11 +22,11 @@ DOCKER_IMAGE_NUMBERED_TAG=foliant/foliant:${FOLIANT_VERSION}-full
GITHUB_REGISTRY_URL=ghcr.io
ORGANIZATION=foliant-docs

docker pull $GITHUB_REGISTRY_URL/$ORGANIZATION/foliant/foliant:pandoc
docker login $GITHUB_REGISTRY_URL
# docker pull $GITHUB_REGISTRY_URL/$ORGANIZATION/foliant/foliant:pandoc
# docker login $GITHUB_REGISTRY_URL
docker build --no-cache -t $DOCKER_IMAGE_TAG -t $DOCKER_IMAGE_NUMBERED_TAG -f Dockerfile-full ./ 2>&1 | tee ./build.log
docker tag $DOCKER_IMAGE_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
docker tag $DOCKER_IMAGE_NUMBERED_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_NUMBERED_TAG
docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_NUMBERED_TAG
docker logout $GITHUB_REGISTRY_URL
# docker tag $DOCKER_IMAGE_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
# docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
# docker tag $DOCKER_IMAGE_NUMBERED_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_NUMBERED_TAG
# docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_NUMBERED_TAG
# docker logout $GITHUB_REGISTRY_URL
10 changes: 5 additions & 5 deletions build_latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ DOCKER_IMAGE_TAG=foliant/foliant
GITHUB_REGISTRY_URL=ghcr.io
ORGANIZATION=foliant-docs

docker pull $GITHUB_REGISTRY_URL/$ORGANIZATION/foliant/foliant:slim
docker login $GITHUB_REGISTRY_URL
# docker pull $GITHUB_REGISTRY_URL/$ORGANIZATION/foliant/foliant:slim
# docker login $GITHUB_REGISTRY_URL
docker build --no-cache -t $DOCKER_IMAGE_TAG ./ 2>&1 | tee ./build.log
docker tag $DOCKER_IMAGE_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
docker logout $GITHUB_REGISTRY_URL
# docker tag $DOCKER_IMAGE_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
# docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
# docker logout $GITHUB_REGISTRY_URL
17 changes: 9 additions & 8 deletions build_pandoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ else
fi

if [ ! $1 ] ; then
FOLIANT_VERSION=`curl https://raw.githubusercontent.com/foliant-docs/foliant/master/foliant/__init__.py | grep -${grep_option}o "\d+\.\d+\.\d+"`
# TODO: switch add-partial-copy to master
FOLIANT_VERSION=`curl https://raw.githubusercontent.com/foliant-docs/foliant/add-partial-copy/foliant/__init__.py | grep -${grep_option}o "\d+\.\d+\.\d+"`
else
FOLIANT_VERSION=$1
fi
Expand All @@ -21,11 +22,11 @@ DOCKER_IMAGE_NUMBERED_TAG=foliant/foliant:${FOLIANT_VERSION}-pandoc
GITHUB_REGISTRY_URL=ghcr.io
ORGANIZATION=foliant-docs

docker pull $GITHUB_REGISTRY_URL/$ORGANIZATION/foliant/foliant
docker login $GITHUB_REGISTRY_URL
# docker pull $GITHUB_REGISTRY_URL/$ORGANIZATION/foliant/foliant
# docker login $GITHUB_REGISTRY_URL
docker build --no-cache -t $DOCKER_IMAGE_TAG -t $DOCKER_IMAGE_NUMBERED_TAG -f Dockerfile-pandoc ./ 2>&1 | tee ./build.log
docker tag $DOCKER_IMAGE_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
docker tag $DOCKER_IMAGE_NUMBERED_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_NUMBERED_TAG
docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_NUMBERED_TAG
docker logout $GITHUB_REGISTRY_URL
# docker tag $DOCKER_IMAGE_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
# docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
# docker tag $DOCKER_IMAGE_NUMBERED_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_NUMBERED_TAG
# docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_NUMBERED_TAG
# docker logout $GITHUB_REGISTRY_URL
15 changes: 8 additions & 7 deletions build_slim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ else
fi

if [ ! $1 ] ; then
FOLIANT_VERSION=`curl https://raw.githubusercontent.com/foliant-docs/foliant/master/foliant/__init__.py | grep -${grep_option}o "\d+\.\d+\.\d+"`
# TODO: switch add-partial-copy to master
FOLIANT_VERSION=`curl https://raw.githubusercontent.com/foliant-docs/foliant/add-partial-copy/foliant/__init__.py | grep -${grep_option}o "\d+\.\d+\.\d+"`
else
FOLIANT_VERSION=$1
fi
Expand All @@ -22,10 +23,10 @@ GITHUB_REGISTRY_URL=ghcr.io
ORGANIZATION=foliant-docs

docker pull ubuntu:focal
docker login $GITHUB_REGISTRY_URL
# docker login $GITHUB_REGISTRY_URL
docker build --no-cache --build-arg VERSION=${FOLIANT_VERSION} -t $DOCKER_IMAGE_TAG -t $DOCKER_IMAGE_NUMBERED_TAG -f Dockerfile-slim ./ 2>&1 | tee ./build.log
docker tag $DOCKER_IMAGE_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
docker tag $DOCKER_IMAGE_NUMBERED_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_NUMBERED_TAG
docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_NUMBERED_TAG
docker logout $GITHUB_REGISTRY_URL
# docker tag $DOCKER_IMAGE_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
# docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_TAG
# docker tag $DOCKER_IMAGE_NUMBERED_TAG $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_NUMBERED_TAG
# docker push $GITHUB_REGISTRY_URL/$ORGANIZATION/$DOCKER_IMAGE_NUMBERED_TAG
# docker logout $GITHUB_REGISTRY_URL
2 changes: 0 additions & 2 deletions dependency_files/python_packages/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,11 @@ foliantcontrib.yaml_include >= 1.0.1

archeme >= 1.0.2
Jinja2 == 3.1.2
lxml == 4.9.1
MarkupSafe == 2.0.1
mkdocs == 1.3.0
mkdocs-material == 8.2.14
mkdocs-material-extensions == 1.0.3
pydbml >= 1.0.5
pygments == 2.12.0
pymdown-extensions == 9.4
PyYAML == 5.4
schema == 0.7.4