2023-03-20 22:55:11 +01:00
|
|
|
# Build jbig2enc in a separate stage
|
2023-07-23 01:03:25 +02:00
|
|
|
FROM frooodle/stirling-pdf-base:beta4
|
2023-05-01 22:57:48 +02:00
|
|
|
|
2023-08-27 14:45:37 +02:00
|
|
|
ARG VERSION_TAG
|
|
|
|
ENV VERSION_TAG=$VERSION_TAG
|
|
|
|
|
|
|
|
ENV ENABLE_SECURITY=false
|
|
|
|
|
|
|
|
ARG ALPHA=false
|
|
|
|
ENV ALPHA=$ALPHA
|
2023-08-27 12:59:08 +02:00
|
|
|
|
|
|
|
|
2023-05-01 22:57:48 +02:00
|
|
|
# Create scripts folder and copy local scripts
|
|
|
|
RUN mkdir /scripts
|
|
|
|
COPY ./scripts/* /scripts/
|
2023-03-20 22:55:11 +01:00
|
|
|
|
2023-06-30 00:59:15 +02:00
|
|
|
#Install fonts
|
|
|
|
RUN mkdir /usr/share/fonts/opentype/noto/
|
|
|
|
COPY src/main/resources/static/fonts/*.ttf /usr/share/fonts/opentype/noto/
|
|
|
|
COPY src/main/resources/static/fonts/*.otf /usr/share/fonts/opentype/noto/
|
|
|
|
RUN fc-cache -f -v
|
|
|
|
|
2023-08-27 12:59:08 +02:00
|
|
|
# Depending on the ENABLE_SECURITY flag, download the correct JAR
|
2023-08-27 14:45:37 +02:00
|
|
|
COPY build/libs/*.jar app-temp.jar
|
|
|
|
RUN if [ "$ALPHA" = "true" ]; then \
|
|
|
|
mv app-temp.jar app.jar; \
|
|
|
|
elif [ "$ENABLE_SECURITY" = "true" ]; then \
|
|
|
|
wget -O app.jar https://github.com/Frooodle/Stirling-PDF/releases/download/$VERSION_TAG/Stirling-PDF-with-login-$VERSION_TAG.jar; \
|
|
|
|
rm -f app-temp.jar; \
|
2023-08-27 12:59:08 +02:00
|
|
|
else \
|
2023-08-27 14:45:37 +02:00
|
|
|
wget -O app.jar https://github.com/Frooodle/Stirling-PDF/releases/download/$VERSION_TAG/Stirling-PDF-$VERSION_TAG.jar; \
|
|
|
|
rm -f app-temp.jar; \
|
2023-08-27 12:59:08 +02:00
|
|
|
fi
|
2023-08-27 14:45:37 +02:00
|
|
|
|
2023-03-20 22:55:11 +01:00
|
|
|
# Expose the application port
|
2023-01-27 19:23:40 +01:00
|
|
|
EXPOSE 8080
|
2023-03-20 22:55:11 +01:00
|
|
|
|
|
|
|
# Set environment variables
|
2023-04-02 12:51:07 +02:00
|
|
|
ENV APP_HOME_NAME="Stirling PDF"
|
2023-03-20 22:55:11 +01:00
|
|
|
|
|
|
|
# Run the application
|
2023-05-01 23:31:30 +02:00
|
|
|
RUN chmod +x /scripts/init.sh
|
2023-05-01 22:57:48 +02:00
|
|
|
ENTRYPOINT ["/scripts/init.sh"]
|
|
|
|
CMD ["java", "-jar", "/app.jar"]
|