1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

Merge branch 'bpatrik:master' into master
Some checks failed
pigallery2 / pigallery2-Gitea-Actions (push) Failing after 5m54s

This commit is contained in:
xuthus 2024-07-06 19:27:44 +08:00 committed by GitHub
commit 932f6397e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 15 additions and 58 deletions

View File

@ -22,7 +22,7 @@ jobs:
with:
mysql database: 'pigallery_test'
mysql root password: 'password'
mysql user: 'user'
mysql user: 'user'
mysql password: 'password'
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
@ -100,12 +100,10 @@ jobs:
needs: [ create-release ]
strategy:
matrix:
container: [alpine, debian-buster, debian-bullseye, debian-bookworm ]
container: [alpine, debian-bullseye, debian-bookworm ]
include:
- container: alpine
platforms: linux/amd64,linux/arm64,linux/arm/v7
- container: debian-buster
platforms: linux/amd64,linux/arm64,linux/arm/v7
- container: debian-bullseye
platforms: linux/amd64,linux/arm64,linux/arm/v7
- container: debian-bookworm

View File

@ -2,7 +2,7 @@
#-----------------------------------------
FROM node:18-alpine3.17 AS builder
RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.17/community/ \
python3 build-base sqlite-dev sqlite-libs vips-dev vips-heif 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-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
RUN npm install --unsafe-perm --fetch-timeout=90000
@ -27,12 +27,12 @@ ENV NODE_ENV=production \
EXPOSE 80
RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.17/community/ \
vips vips-cpp vips-heif ffmpeg
vips vips-cpp vips-heif vips-magick ffmpeg
COPY --from=builder /app /app
VOLUME ["/app/data/config", "/app/data/db", "/app/data/images", "/app/data/tmp"]
# 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"]
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

View File

@ -1,6 +1,6 @@
#-----------------BUILDER-----------------
#-----------------------------------------
FROM node:18.19-bookworm AS builder
FROM node:18-bookworm AS builder
RUN apt update && apt install -y --no-install-recommends libvips-dev python3
COPY pigallery2-release /app
WORKDIR /app
@ -33,7 +33,7 @@ COPY --from=builder /app /app
VOLUME ["/app/data/config", "/app/data/db", "/app/data/images", "/app/data/tmp"]
# 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"]
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

View File

@ -1,6 +1,6 @@
#-----------------BUILDER-----------------
#-----------------------------------------
FROM node:18.19-bullseye AS builder
FROM node:18-bullseye AS builder
RUN apt update && apt install -y --no-install-recommends libvips-dev python3
COPY pigallery2-release /app
WORKDIR /app
@ -33,7 +33,7 @@ COPY --from=builder /app /app
VOLUME ["/app/data/config", "/app/data/db", "/app/data/images", "/app/data/tmp"]
# 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"]
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

View File

@ -1,6 +1,6 @@
#-----------------BUILDER-----------------
#-----------------------------------------
FROM node:18-buster AS builder
FROM node:18-bullseye AS builder
# LABEL maintainer="Patrik J. Braun"
# copying only package{-lock}.json to make node_modules cachable
RUN git clone https://github.com/bpatrik/pigallery2.git /build
@ -16,7 +16,7 @@ RUN npm install --unsafe-perm \
#-----------------MAIN--------------------
#-----------------------------------------
FROM node:18-buster-slim AS main
FROM node:18-bullseye-slim AS main
WORKDIR /app
ENV NODE_ENV=production \
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)

View File

@ -1,44 +0,0 @@
#-----------------BUILDER-----------------
#-----------------------------------------
FROM node:18.19-buster AS builder
RUN apt update && apt install -y --no-install-recommends libvips-dev python3
COPY pigallery2-release /app
WORKDIR /app
RUN npm install --unsafe-perm --fetch-timeout=90000
RUN mkdir -p /app/data/config && \
mkdir -p /app/data/db && \
mkdir -p /app/data/images && \
mkdir -p /app/data/tmp
#-----------------MAIN--------------------
#-----------------------------------------
FROM node:18-buster-slim AS main
WORKDIR /app
ENV NODE_ENV=production \
# overrides only the default value of the settings (the actualy 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 environemnt
PI_DOCKER=true
EXPOSE 80
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates wget ffmpeg libvips42 \
&& apt-get clean -q -y \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app /app
VOLUME ["/app/data/config", "/app/data/db", "/app/data/images", "/app/data/tmp"]
# 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"]
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
# after a extensive job (like video converting), pigallery calls gc, to clean up everthing 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"]

View File

@ -167,6 +167,7 @@ gulp.task('copy-static', (): any =>
gulp
.src(
[
'src/backend/model/diagnostics/image_formats/**',
'src/backend/model/diagnostics/blank.jpg',
'README.md',
// 'package-lock.json', should not add, it keeps optional packages optional even with --force-opt-packages.

View File

@ -313,8 +313,10 @@ export class ConfigDiagnostics {
// Check if a test available for this image format.
// if not probably because it is trivial
if (!fs.existsSync(testImage)) {
Logger.silly(LOG_TAG, `No test for ${ext} image format. skipping.`);
continue;
}
Logger.silly(LOG_TAG, `Testing ${ext} image formats.`);
try {
await PhotoWorker.renderFromImage({
type: ThumbnailSourceType.Photo,

Binary file not shown.

Binary file not shown.

View File

@ -1266,7 +1266,7 @@ export class ClientPhotoConfig {
},
description: $localize`Photo formats that are supported. Browser needs to support these formats natively. Also sharp (libvips) package should be able to convert these formats.`,
})
supportedFormats: string[] = ['gif', 'jpeg', 'jpg', 'jpe', 'png', 'webp', 'svg', 'avif', 'heic'];
supportedFormats: string[] = ['gif', 'jpeg', 'jpg', 'jpe', 'png', 'webp', 'svg', 'avif', 'heic', 'dng', 'arw'];
}
@SubConfigClass({tags: {client: true}, softReadonly: true})