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

Self managed drawio image #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
40 changes: 39 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1,39 @@
FROM jgraph/drawio:latest
ARG BASE_IMAGE=alpine:3.20.3

FROM $BASE_IMAGE AS builder

ARG SHA256SUM_1=f799541380bfff2b674cefd86c5376d2d7d566b3a2e7c4579d2b491de8ec6c36
ARG SHA256SUM_2=89417f1e6e0b1498ea22d7ebb9ec3bed126719c0a1b9a1cb76ac31020027e6ee

RUN apk add --no-cache wget tar \
&& wget https://archive.apache.org/dist/tomcat/tomcat-10/v10.1.34/bin/apache-tomcat-10.1.34.tar.gz \
&& echo "$SHA256SUM_1 apache-tomcat-10.1.34.tar.gz" | sha256sum -c - \
&& mkdir -p /opt/tomcat \
&& tar xzf apache-tomcat-10.1.34.tar.gz -C /opt/tomcat --strip-components 1 \
&& rm apache-tomcat-10.1.34.tar.gz

RUN wget https://github.com/jgraph/drawio/releases/download/v24.7.17/draw.war \
&& echo "$SHA256SUM_2 draw.war" | sha256sum -c - \
&& unzip draw.war -d /opt/tomcat/webapps/_diagram \
&& rm -rf draw.war


FROM $BASE_IMAGE AS main

ARG JAVA_OPTS="-Xverify:none"
ENV JAVA_OPTS=$JAVA_OPTS
ENV USER=tomcat
ARG UID=1000
ENV UID=$UID

COPY ./root-fs/usr/local/bin/startup.sh /usr/local/bin/

RUN apk add --no-cache openjdk21 \
&& addgroup -g $UID $USER \
&& adduser -G $USER -u $UID --disabled-password --gecos "" $USER \
&& chmod +x /usr/local/bin/startup.sh

COPY --from=builder --chown=tomcat:tomcat /opt/tomcat /opt/tomcat
EXPOSE 8080
USER $USER
ENTRYPOINT [ "/usr/local/bin/startup.sh" ]
10 changes: 10 additions & 0 deletions root-fs/usr/local/bin/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

set -o errexit
set -o nounset
set -o pipefail

exec /opt/tomcat/bin/catalina.sh run