1
0
mirror of https://github.com/octoleo/plantuml-server.git synced 2024-12-22 08:48:54 +00:00
plantuml-server/Dockerfile.tomcat
2023-03-29 19:36:33 +02:00

53 lines
1.7 KiB
Docker

FROM maven:3-jdk-11-slim AS builder
COPY pom.xml /app/
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-openjdk-slim
RUN apt-get update && \
apt-get install -y --no-install-recommends \
fonts-noto-cjk \
libgd3 \
&& \
rm -rf /var/lib/apt/lists/*
# Build Graphviz from source because there are no binary distributions for recent versions
ARG GRAPHVIZ_VERSION=7.1.0
ARG GRAPHVIZ_BUILD_DIR=/tmp/graphiz-build
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
build-essential \
&& \
mkdir -p $GRAPHVIZ_BUILD_DIR && \
cd $GRAPHVIZ_BUILD_DIR && \
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 && \
apt-get remove -y curl build-essential && \
rm -rf /var/lib/apt/lists/* && \
rm -rf $GRAPHVIZ_BUILD_DIR
COPY docker-entrypoint.tomcat.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENV WEBAPP_PATH=$CATALINA_HOME/webapps
RUN rm -rf $WEBAPP_PATH && \
mkdir -p $WEBAPP_PATH
COPY --from=builder /app/target/plantuml.war /plantuml.war
ENTRYPOINT ["/entrypoint.sh"]
CMD ["catalina.sh", "run"]
# Openshift https://docs.openshift.com/container-platform/4.9/openshift_images/create-images.html#images-create-guide-openshift_create-images
USER root
RUN chgrp -R 0 $CATALINA_HOME && chmod -R g=u $CATALINA_HOME