1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-12-01 22:52:06 +02:00

try adding vips to builder

This commit is contained in:
Patrik J. Braun
2025-07-30 00:46:22 +02:00
parent 3141bbe522
commit 041ceee790

View File

@@ -1,8 +1,11 @@
#-----------------BUILDER-----------------
#-----------------------------------------
FROM node:22-alpine3.22 AS builder
# Install all build deps, including vips-dev (headers for sharp to build)
RUN apk add --no-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.22/community/ \
python3 build-base sqlite-dev sqlite-libs imagemagick-dev libraw-dev vips-dev vips-heif vips-magick fftw-dev gcc g++ make libc6-compat && ln -snf /usr/bin/python3 /usr/bin/python
python3 build-base sqlite-dev sqlite-libs imagemagick-dev libraw-dev vips vips-dev vips-heif vips-magick fftw-dev gcc g++ make libc6-compat \
&& ln -snf /usr/bin/python3 /usr/bin/python
COPY pigallery2-release /app
WORKDIR /app
@@ -17,26 +20,29 @@ RUN mkdir -p /app/data/config && \
#-----------------------------------------
FROM node:22-alpine3.22 AS main
WORKDIR /app
ENV NODE_ENV=production \
# overrides only the default value of the settings (the actual value can be overwritten through config.json)
default-Database-dbFolder=/app/data/db \
default-Media-folder=/app/data/images \
default-Media-tempFolder=/app/data/tmp \
default-Extensions-folder=/app/data/config/extensions \
# flagging dockerized environment
PI_DOCKER=true
EXPOSE 80
# Install only runtime vips (lighter image, no -dev headers)
RUN apk add --no-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.22/community/ \
vips vips-cpp vips-heif vips-magick ffmpeg
# Copy built app from builder stage
COPY --from=builder /app /app
# Run build time diagnostics to make sure the app would work after build is finished
RUN ["node", "./src/backend/index", "--expose-gc", "--run-diagnostics", "--config-path=/app/diagnostics-config.json", "--Server-Log-level=silly"]
# Run build-time diagnostics
RUN ["node", "./src/backend/index", "--expose-gc", "--run-diagnostics", "--config-path=/app/diagnostics-config.json", "--Server-Log-level=silly"]
HEALTHCHECK --interval=40s --timeout=30s --retries=3 --start-period=60s \
CMD wget --quiet --tries=1 --no-check-certificate --spider \
http://127.0.0.1:80/heartbeat || exit 1
CMD wget --quiet --tries=1 --no-check-certificate --spider http://127.0.0.1:80/heartbeat || exit 1
# after a extensive job (like video converting), pigallery calls gc, to clean up everything as fast as possible
# Exec form entrypoint is need otherwise (using shell form) ENV variables are not properly passed down to the app
ENTRYPOINT ["node", "./src/backend/index", "--expose-gc", "--config-path=/app/data/config/config.json"]
ENTRYPOINT ["node", "./src/backend/index", "--expose-gc", "--config-path=/app/data/config/config.json"]