@@ -28,8 +28,8 @@ WORKDIR /app/server
2828RUN source "$HOME/.sdkman/bin/sdkman-init.sh" \
2929 && ANT_OPTS="-Dfile.encoding=UTF8" ant -f mirth-build.xml -DdisableSigning=true
3030
31- # Stage 2: Runtime container
32- FROM eclipse-temurin:21.0.7_6-jre -noble
31+ # Stage 2b: JDK runtime container
32+ FROM eclipse-temurin:21.0.7_6-jdk -noble as jdk-run
3333
3434RUN groupadd mirth \
3535 && usermod -l mirth ubuntu \
@@ -55,3 +55,33 @@ EXPOSE 8443
5555USER mirth
5656ENTRYPOINT [ "/opt/connect/entrypoint.sh" ]
5757CMD ["/opt/connect/mirth-connect.sh" ]
58+
59+ # Stage 2b: JRE runtime container
60+ FROM eclipse-temurin:21.0.7_6-jre-alpine as jre-run
61+
62+ # Alpine does not include bash by default, so we install it
63+ RUN apk add --no-cache bash
64+ # useradd and groupadd are not available in Alpine
65+ RUN addgroup -S mirth \
66+ && adduser -S -g mirth mirth \
67+ && mkdir -p /opt/connect/appdata \
68+ && chown -R mirth:mirth /opt/connect
69+
70+ WORKDIR /opt/connect
71+ COPY --chmod=0755 docker/entrypoint.sh docker/mirth-connect.sh ./
72+ COPY --chown=mirth:mirth --from=builder \
73+ --exclude=cli-lib \
74+ --exclude=mirth-cli-launcher.jar \
75+ --exclude=mccommand \
76+ --exclude=manager-lib \
77+ --exclude=mirth-manager-launcher.jar \
78+ --exclude=mcmanager \
79+ /app/server/setup ./
80+
81+ VOLUME /opt/connect/appdata
82+ VOLUME /opt/connect/custom-extensions
83+ EXPOSE 8443
84+
85+ USER mirth
86+ ENTRYPOINT [ "/opt/connect/entrypoint.sh" ]
87+ CMD ["/opt/connect/mirth-connect.sh" ]
0 commit comments