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:
- name: stirling-pdf
git:
branch: deployScripts
branch: digitalOcean
repo_clone_url: https://github.com/Frooodle/Stirling-PDF.git
dockerfile_path: Dockerfile2
envs:

View File

@ -11,27 +11,54 @@ WORKDIR /downloader
RUN curl -s https://api.github.com/repos/Frooodle/Stirling-PDF/releases/latest \
| jq -r ".assets[] | select(.name == \"Stirling-PDF.jar\") | .browser_download_url" \
| xargs curl -L -o Stirling-PDF.jar
# Use the base image
FROM frooodle/stirling-pdf-base:version8
ARG VERSION_TAG
# Production stage
FROM frooodle/stirling-pdf-base:beta4
# Set Environment Variables
ENV DOCKER_ENABLE_SECURITY=false \
HOME=/home/stirlingpdfuser \
VERSION_TAG=$VERSION_TAG
# PUID=1000 \
# PGID=1000 \
# UMASK=022 \
# Create scripts folder and copy local scripts
RUN mkdir /scripts
# 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/
# 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 src/main/resources/static/fonts/*.otf /usr/share/fonts/opentype/noto/
# 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
# Run the application
RUN chmod +x /scripts/init.sh
# Set user and run command
##USER stirlingpdfuser
ENTRYPOINT ["/scripts/init.sh"]
CMD ["java", "-jar", "/app.jar"]