digital ocean update

This commit is contained in:
Anthony Stirling 2023-12-25 20:55:55 +00:00
parent 15b9f99c2e
commit c7158ab969
2 changed files with 40 additions and 13 deletions

View File

@ -3,7 +3,7 @@ spec:
services: services:
- name: stirling-pdf - name: stirling-pdf
git: git:
branch: deployScripts branch: digitalOcean
repo_clone_url: https://github.com/Frooodle/Stirling-PDF.git repo_clone_url: https://github.com/Frooodle/Stirling-PDF.git
dockerfile_path: Dockerfile2 dockerfile_path: Dockerfile2
envs: envs:

View File

@ -13,25 +13,52 @@ RUN curl -s https://api.github.com/repos/Frooodle/Stirling-PDF/releases/latest \
| xargs curl -L -o Stirling-PDF.jar | xargs curl -L -o Stirling-PDF.jar
# Production stage # Use the base image
FROM frooodle/stirling-pdf-base:beta4 FROM frooodle/stirling-pdf-base:version8
# Create scripts folder and copy local scripts ARG VERSION_TAG
RUN mkdir /scripts
# Set Environment Variables
ENV DOCKER_ENABLE_SECURITY=false \
HOME=/home/stirlingpdfuser \
VERSION_TAG=$VERSION_TAG
# PUID=1000 \
# PGID=1000 \
# UMASK=022 \
# Create user and group
##RUN groupadd -g $PGID stirlingpdfgroup && \
## useradd -u $PUID -g stirlingpdfgroup -s /bin/sh stirlingpdfuser && \
## mkdir -p $HOME && chown stirlingpdfuser:stirlingpdfgroup $HOME
# Set up necessary directories and permissions
RUN mkdir -p /scripts /usr/share/fonts/opentype/noto /usr/share/tesseract-ocr /configs /customFiles
##&& \
## chown -R stirlingpdfuser:stirlingpdfgroup /scripts /usr/share/fonts/opentype/noto /usr/share/tesseract-ocr /configs /customFiles && \
## chown -R stirlingpdfuser:stirlingpdfgroup /usr/share/tesseract-ocr-original
# Copy necessary files
COPY ./scripts/* /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/ COPY src/main/resources/static/fonts/*.ttf /usr/share/fonts/opentype/noto/
RUN fc-cache -f -v COPY src/main/resources/static/fonts/*.otf /usr/share/fonts/opentype/noto/
# Copy the application JAR file from the download stage # Copy the application JAR file from the download stage
COPY --from=downloader /downloader/Stirling-PDF.jar /app.jar COPY --from=downloader /downloader/*.jar /app.jar
# Expose the application port # Set font cache and permissions
RUN fc-cache -f -v && chmod +x /scripts/*
##&& \
## chown stirlingpdfuser:stirlingpdfgroup /app.jar && \
## chmod +x /scripts/init.sh
# Expose necessary ports
EXPOSE 8080 EXPOSE 8080
# Run the application # Set user and run command
RUN chmod +x /scripts/init.sh ##USER stirlingpdfuser
ENTRYPOINT ["/scripts/init.sh"] ENTRYPOINT ["/scripts/init.sh"]
CMD ["java", "-jar", "/app.jar"] CMD ["java", "-jar", "/app.jar"]