1
0
mirror of https://github.com/octoleo/plantuml-server.git synced 2024-11-15 00:44:05 +00:00
plantuml-server/Dockerfile.tomcat

66 lines
2.1 KiB
Docker
Raw Normal View History

FROM maven:3-eclipse-temurin-11 AS builder
COPY pom.xml /app/
2021-10-11 15:33:30 +00:00
COPY src/main /app/src/main/
WORKDIR /app
RUN mvn --batch-mode --define java.net.useSystemProxies=true -Dapache-jsp.scope=compile package
########################################################################################
FROM tomcat:10-jdk11
RUN apt-get update && \
2021-10-11 15:33:30 +00:00
apt-get install -y --no-install-recommends \
curl \
2021-10-11 15:33:30 +00:00
fonts-noto-cjk \
libgd3 \
2021-10-11 15:33:30 +00:00
&& \
rm -rf /var/lib/apt/lists/*
# Build Graphviz from source because there are no binary distributions for recent versions
ARG GRAPHVIZ_VERSION
ARG GRAPHVIZ_BUILD_DIR=/tmp/graphiz-build
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
jq \
libexpat1-dev \
2023-04-11 15:00:29 +00:00
libgd-dev \
zlib1g-dev \
&& \
mkdir -p $GRAPHVIZ_BUILD_DIR && \
cd $GRAPHVIZ_BUILD_DIR && \
GRAPHVIZ_VERSION=${GRAPHVIZ_VERSION:-$(curl -s https://gitlab.com/api/v4/projects/4207231/releases/ | jq -r '.[] | .name' | sort -V -r | head -1)} && \
curl -o graphviz.tar.gz https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/${GRAPHVIZ_VERSION}/graphviz-${GRAPHVIZ_VERSION}.tar.gz && \
tar -xzf graphviz.tar.gz && \
cd graphviz-$GRAPHVIZ_VERSION && \
./configure && \
make && \
make install && \
2023-04-11 15:00:29 +00:00
apt-get remove -y \
build-essential \
jq \
2023-04-11 15:00:29 +00:00
libexpat1-dev \
libgd-dev \
zlib1g-dev \
&& \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf $GRAPHVIZ_BUILD_DIR
2023-01-25 15:35:10 +00:00
COPY docker-entrypoint.tomcat.sh /entrypoint.sh
2021-10-11 15:33:30 +00:00
RUN chmod +x /entrypoint.sh
2023-01-25 15:35:10 +00:00
ENV WEBAPP_PATH=$CATALINA_HOME/webapps
2021-10-11 15:33:30 +00:00
RUN rm -rf $WEBAPP_PATH && \
mkdir -p $WEBAPP_PATH
2023-01-25 15:35:10 +00:00
COPY --from=builder /app/target/plantuml.war /plantuml.war
2022-11-07 11:35:38 +00:00
# Openshift https://docs.openshift.com/container-platform/4.9/openshift_images/create-images.html#images-create-guide-openshift_create-images
2022-11-07 11:53:31 +00:00
RUN chgrp -R 0 $CATALINA_HOME && chmod -R g=u $CATALINA_HOME
ENTRYPOINT ["/entrypoint.sh"]
CMD ["catalina.sh", "run"]