Stirling-PDF/Dockerfile-do
2023-07-29 00:51:28 +01:00

38 lines
835 B
Plaintext

# Build stage
FROM openjdk:17-jdk-slim AS build
# Set the current working directory
WORKDIR /app
# Copy everything into the current directory in the image
COPY . .
# Give execution permissions to gradlew
RUN chmod +x ./gradlew
# Run the build
RUN ./gradlew build
# Production stage
FROM frooodle/stirling-pdf-base:beta4
# Create scripts folder and copy local scripts
RUN mkdir /scripts
COPY ./scripts/* /scripts/
# Install fonts
RUN mkdir /usr/share/fonts/opentype/noto/
COPY src/main/resources/static/fonts/*.ttf /usr/share/fonts/opentype/noto/
RUN fc-cache -f -v
# Copy the application JAR file from the build stage
COPY --from=build /app/build/libs/*.jar app.jar
# Expose the application port
EXPOSE 8080
# Run the application
RUN chmod +x /scripts/init.sh
ENTRYPOINT ["/scripts/init.sh"]
CMD ["java", "-jar", "/app.jar"]