mirror of
https://github.com/immich-app/immich.git
synced 2025-08-11 09:16:31 -04:00
Review comments, minor tweaks
This commit is contained in:
parent
687e99ca06
commit
6c81d087c9
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
@ -233,7 +233,7 @@ jobs:
|
||||
run: pnpm install --frozen-lockfile && pnpm build
|
||||
working-directory: ./open-api/typescript-sdk
|
||||
- name: Run npm install
|
||||
run: SKIP_SHARP_FILTERING=true pnpm install --frozen-lockfile
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Run tsc
|
||||
run: pnpm check:typescript
|
||||
if: ${{ !cancelled() }}
|
||||
@ -341,7 +341,7 @@ jobs:
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: '**/pnpm-lock.yaml'
|
||||
- name: Run pnpm install
|
||||
run: SKIP_SHARP_FILTERING=true pnpm install --frozen-lockfile
|
||||
run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm install --frozen-lockfile
|
||||
- name: Run medium tests
|
||||
run: pnpm test:medium
|
||||
if: ${{ !cancelled() }}
|
||||
@ -565,7 +565,7 @@ jobs:
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: '**/pnpm-lock.yaml'
|
||||
- name: Install server dependencies
|
||||
run: SKIP_SHARP_FILTERING=true pnpm --filter immich install --frozen-lockfile
|
||||
run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm --filter immich install --frozen-lockfile
|
||||
- name: Build the app
|
||||
run: pnpm --filter immich build
|
||||
- name: Run API generation
|
||||
@ -619,7 +619,7 @@ jobs:
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: '**/pnpm-lock.yaml'
|
||||
- name: Install server dependencies
|
||||
run: SKIP_SHARP_FILTERING=true pnpm install --frozen-lockfile
|
||||
run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm install --frozen-lockfile
|
||||
- name: Build the app
|
||||
run: pnpm build
|
||||
- name: Run existing migrations
|
||||
|
@ -3,6 +3,7 @@ module.exports = {
|
||||
readPackage: (pkg) => {
|
||||
if (pkg.name && pkg.name === "exiftool-vendored") {
|
||||
if (pkg.optionalDependencies["exiftool-vendored.pl"]) {
|
||||
// make exiftool-vendored.pl a regular dependency
|
||||
pkg.dependencies["exiftool-vendored.pl"] =
|
||||
pkg.optionalDependencies["exiftool-vendored.pl"];
|
||||
delete pkg.optionalDependencies["exiftool-vendored.pl"];
|
||||
@ -13,7 +14,15 @@ module.exports = {
|
||||
(dep) => dep.startsWith("@img")
|
||||
);
|
||||
for (const dep of optionalDeps) {
|
||||
if (dep.includes("musl") || process.env.SKIP_SHARP_FILTERING) {
|
||||
// remove all optionalDepdencies from sharp (they will be compiled from source), except:
|
||||
// include the precompiled musl version of sharp, for web/Dockerfile
|
||||
// include precompiled linux-x64 version of sharp, for server/Dockerfile, stage: web-prod
|
||||
// include precompiled linux-arm64 version of sharp, for server/Dockerfile, stage: web-prod
|
||||
if (
|
||||
dep.includes("musl") ||
|
||||
dep.includes("linux-x64") ||
|
||||
dep.includes("linux-arm64")
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
delete pkg.optionalDependencies[dep];
|
||||
|
2
Makefile
2
Makefile
@ -8,7 +8,7 @@ dev-update:
|
||||
@trap 'make dev-down' EXIT; COMPOSE_BAKE=true docker compose -f ./docker/docker-compose.dev.yml up --build -V --remove-orphans
|
||||
|
||||
dev-scale:
|
||||
@trap 'make dev-down' EXIT; COMPOSE_BAKE=true docker compose -f ./docker/docker-compose.dev.yml up --build -V --scale immich-server=3 --remove-orphans
|
||||
@trap 'make dev-down' EXIT; COMPOSE_BAKE=true docker compose -f ./docker/docker-compose.dev.yml up --build -V --scale immich-server=3 --remove-orphans
|
||||
|
||||
dev-docs:
|
||||
npm --prefix docs run start
|
||||
|
@ -17,8 +17,6 @@ services:
|
||||
immich-server:
|
||||
container_name: immich_server
|
||||
command: ['immich-dev']
|
||||
# entrypoint: ["/bin/sh"]
|
||||
# command: ["-c", "sleep infinity"]
|
||||
image: immich-server-dev:latest
|
||||
# extends:
|
||||
# file: hwaccel.transcoding.yml
|
||||
|
@ -15,7 +15,7 @@ function dart {
|
||||
patch --no-backup-if-mismatch -u api.mustache <api.mustache.patch
|
||||
|
||||
cd ../../
|
||||
npx --yes @openapitools/openapi-generator-cli generate -g dart -i ./immich-openapi-specs.json -o ../mobile/openapi -t ./templates/mobile
|
||||
pnpx @openapitools/openapi-generator-cli generate -g dart -i ./immich-openapi-specs.json -o ../mobile/openapi -t ./templates/mobile
|
||||
|
||||
# Post generate patches
|
||||
patch --no-backup-if-mismatch -u ../mobile/openapi/lib/api_client.dart <./patch/api_client.dart.patch
|
||||
@ -27,16 +27,15 @@ function dart {
|
||||
}
|
||||
|
||||
function typescript {
|
||||
npx --yes oazapfts --optimistic --argumentStyle=object --useEnumType immich-openapi-specs.json typescript-sdk/src/fetch-client.ts
|
||||
pnpx oazapfts --optimistic --argumentStyle=object --useEnumType immich-openapi-specs.json typescript-sdk/src/fetch-client.ts
|
||||
pnpm --filter @immich/sdk install --frozen-lockfile
|
||||
pnpm --filter @immich/sdk build
|
||||
}
|
||||
|
||||
# requires server to be built
|
||||
(
|
||||
cd ..
|
||||
pnpm --filter immich install
|
||||
pnpm --filter immich build
|
||||
cd ..
|
||||
SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm --filter immich build
|
||||
pnpm --filter immich sync:open-api
|
||||
)
|
||||
|
||||
|
57
pnpm-lock.yaml
generated
57
pnpm-lock.yaml
generated
@ -8,23 +8,10 @@ settings:
|
||||
overrides:
|
||||
canvas: 2.11.2
|
||||
sharp: ^0.34.2
|
||||
'@img/sharp-darwin-arm64': '-'
|
||||
'@img/sharp-darwin-x64': '-'
|
||||
'@img/sharp-libvips-darwin-arm64': '-'
|
||||
'@img/sharp-libvips-darwin-x64': '-'
|
||||
'@img/sharp-libvips-linux-ppc64': '-'
|
||||
'@img/sharp-libvips-linux-s390x': '-'
|
||||
'@img/sharp-libvips-linuxmusl-arm64': '-'
|
||||
'@img/sharp-linux-s390x': '-'
|
||||
'@img/sharp-linuxmusl-arm64': '-'
|
||||
'@img/sharp-wasm32': '-'
|
||||
'@img/sharp-win32-arm64': '-'
|
||||
'@img/sharp-win32-ia32': '-'
|
||||
'@img/sharp-win32-x64': '-'
|
||||
|
||||
packageExtensionsChecksum: sha256-OKQJWXvw/5wjnkjESlE5+zrJ2KIPjfGGRpkAjonMYro=
|
||||
packageExtensionsChecksum: sha256-DAYr0FTkvKYnvBH4muAER9UE1FVGKhqfRU4/QwA2xPQ=
|
||||
|
||||
pnpmfileChecksum: sha256-JpGwxClb0+luh+tUPf3D8dtJWrqZ/r0/1oqOJoKoLxU=
|
||||
pnpmfileChecksum: sha256-JydSCGE/nZCNX4UmkEmagfKMgYdl7X4YUSzm835vw9I=
|
||||
|
||||
importers:
|
||||
|
||||
@ -2605,16 +2592,16 @@ packages:
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
'@img/sharp-libvips-linux-arm@1.1.0':
|
||||
resolution: {integrity: sha512-s8BAd0lwUIvYCJyRdFqvsj+BJIpDBSxs6ivrOPm/R7piTs5UIwY5OjXrP2bqXC9/moGsyRa37eYWYCOGVXxVrA==}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
|
||||
'@img/sharp-libvips-linux-x64@1.1.0':
|
||||
resolution: {integrity: sha512-yRj2+reB8iMg9W5sULM3S74jVS7zqSzHG3Ol/twnAAkAhnGQnpjj6e4ayUz7V+FpKypwgs82xbRdYtchTTUB+Q==}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
'@img/sharp-libvips-linuxmusl-arm64@1.1.0':
|
||||
resolution: {integrity: sha512-jYZdG+whg0MDK+q2COKbYidaqW/WTz0cc1E+tMAusiDygrM4ypmSCjOJPmFTvHHJ8j/6cAGyeDWZOsK06tP33w==}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
'@img/sharp-libvips-linuxmusl-x64@1.1.0':
|
||||
resolution: {integrity: sha512-wK7SBdwrAiycjXdkPnGCPLjYb9lD4l6Ze2gSdAGVZrEL05AOUJESWU2lhlC+Ffn5/G+VKuSm6zzbQSzFX/P65A==}
|
||||
cpu: [x64]
|
||||
@ -2626,18 +2613,18 @@ packages:
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
'@img/sharp-linux-arm@0.34.2':
|
||||
resolution: {integrity: sha512-0DZzkvuEOqQUP9mo2kjjKNok5AmnOr1jB2XYjkaoNRwpAYMDzRmAqUIa1nRi58S2WswqSfPOWLNOr0FDT3H5RQ==}
|
||||
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
|
||||
'@img/sharp-linux-x64@0.34.2':
|
||||
resolution: {integrity: sha512-sD7J+h5nFLMMmOXYH4DD9UtSNBD05tWSSdWAcEyzqW8Cn5UxXvsHAxmxSesYUsTOBmUnjtxghKDl15EvfqLFbQ==}
|
||||
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
'@img/sharp-linuxmusl-arm64@0.34.2':
|
||||
resolution: {integrity: sha512-NEE2vQ6wcxYav1/A22OOxoSOGiKnNmDzCYFOZ949xFmrWZOVII1Bp3NqVVpvj+3UeHMFyN5eP/V5hzViQ5CZNA==}
|
||||
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
'@img/sharp-linuxmusl-x64@0.34.2':
|
||||
resolution: {integrity: sha512-DOYMrDm5E6/8bm/yQLCWyuDJwUnlevR8xtF8bs+gjZ7cyUNYXiSf/E8Kp0Ss5xasIaXSHzb888V1BE4i1hFhAA==}
|
||||
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
|
||||
@ -14358,10 +14345,10 @@ snapshots:
|
||||
'@img/sharp-libvips-linux-arm64@1.1.0':
|
||||
optional: true
|
||||
|
||||
'@img/sharp-libvips-linux-arm@1.1.0':
|
||||
'@img/sharp-libvips-linux-x64@1.1.0':
|
||||
optional: true
|
||||
|
||||
'@img/sharp-libvips-linux-x64@1.1.0':
|
||||
'@img/sharp-libvips-linuxmusl-arm64@1.1.0':
|
||||
optional: true
|
||||
|
||||
'@img/sharp-libvips-linuxmusl-x64@1.1.0':
|
||||
@ -14372,16 +14359,16 @@ snapshots:
|
||||
'@img/sharp-libvips-linux-arm64': 1.1.0
|
||||
optional: true
|
||||
|
||||
'@img/sharp-linux-arm@0.34.2':
|
||||
optionalDependencies:
|
||||
'@img/sharp-libvips-linux-arm': 1.1.0
|
||||
optional: true
|
||||
|
||||
'@img/sharp-linux-x64@0.34.2':
|
||||
optionalDependencies:
|
||||
'@img/sharp-libvips-linux-x64': 1.1.0
|
||||
optional: true
|
||||
|
||||
'@img/sharp-linuxmusl-arm64@0.34.2':
|
||||
optionalDependencies:
|
||||
'@img/sharp-libvips-linuxmusl-arm64': 1.1.0
|
||||
optional: true
|
||||
|
||||
'@img/sharp-linuxmusl-x64@0.34.2':
|
||||
optionalDependencies:
|
||||
'@img/sharp-libvips-linuxmusl-x64': 1.1.0
|
||||
@ -23775,13 +23762,13 @@ snapshots:
|
||||
node-gyp: 11.2.0
|
||||
semver: 7.7.2
|
||||
optionalDependencies:
|
||||
'@img/sharp-libvips-linux-arm': 1.1.0
|
||||
'@img/sharp-libvips-linux-arm64': 1.1.0
|
||||
'@img/sharp-libvips-linux-x64': 1.1.0
|
||||
'@img/sharp-libvips-linuxmusl-arm64': 1.1.0
|
||||
'@img/sharp-libvips-linuxmusl-x64': 1.1.0
|
||||
'@img/sharp-linux-arm': 0.34.2
|
||||
'@img/sharp-linux-arm64': 0.34.2
|
||||
'@img/sharp-linux-x64': 0.34.2
|
||||
'@img/sharp-linuxmusl-arm64': 0.34.2
|
||||
'@img/sharp-linuxmusl-x64': 0.34.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
@ -6,8 +6,6 @@ packages:
|
||||
- server
|
||||
- web
|
||||
- .github
|
||||
|
||||
|
||||
ignoredBuiltDependencies:
|
||||
- '@nestjs/core'
|
||||
- '@scarf/scarf'
|
||||
@ -24,28 +22,12 @@ ignoredBuiltDependencies:
|
||||
- protobufjs
|
||||
- ssh2
|
||||
- utimes
|
||||
|
||||
onlyBuiltDependencies:
|
||||
- sharp
|
||||
- '@tailwindcss/oxide'
|
||||
|
||||
overrides:
|
||||
canvas: 2.11.2
|
||||
sharp: ^0.34.2
|
||||
'@img/sharp-darwin-arm64': '-'
|
||||
'@img/sharp-darwin-x64': '-'
|
||||
'@img/sharp-libvips-darwin-arm64': '-'
|
||||
'@img/sharp-libvips-darwin-x64': '-'
|
||||
'@img/sharp-libvips-linux-ppc64': '-'
|
||||
'@img/sharp-libvips-linux-s390x': '-'
|
||||
'@img/sharp-libvips-linuxmusl-arm64': '-'
|
||||
'@img/sharp-linux-s390x': '-'
|
||||
'@img/sharp-linuxmusl-arm64': '-'
|
||||
'@img/sharp-wasm32': '-'
|
||||
'@img/sharp-win32-arm64': '-'
|
||||
'@img/sharp-win32-ia32': '-'
|
||||
'@img/sharp-win32-x64': '-'
|
||||
|
||||
packageExtensions:
|
||||
nestjs-kysely:
|
||||
dependencies:
|
||||
@ -65,13 +47,11 @@ packageExtensions:
|
||||
node-gyp: '*'
|
||||
'@immich/ui':
|
||||
dependencies:
|
||||
tailwindcss: ^4.1.11
|
||||
tailwindcss: '>=4.1'
|
||||
tailwind-variants:
|
||||
dependencies:
|
||||
tailwindcss: ^4.1.11
|
||||
|
||||
tailwindcss: '>=4.1'
|
||||
dedupePeerDependents: false
|
||||
packageImportMethod: hardlink
|
||||
preferWorkspacePackages: true
|
||||
injectWorkspacePackages: true
|
||||
shamefullyHoist: false
|
||||
|
@ -5,11 +5,18 @@ ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
|
||||
CI=1 \
|
||||
COREPACK_HOME=/tmp
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
RUN npm install --global corepack@latest && \
|
||||
corepack enable pnpm && \
|
||||
pnpm config set store-dir /buildcache/pnpm-store
|
||||
echo "store-dir=/buildcache/pnpm-store" >> /usr/local/etc/npmrc && \
|
||||
echo "devdir=/buildcache/node-gyp" >> /usr/local/etc/npmrc
|
||||
|
||||
COPY ./package* ./pnpm* .pnpmfile.cjs /tmp/create-dep-cache/
|
||||
COPY ./web/package* ./web/pnpm* /tmp/create-dep-cache/web/
|
||||
COPY ./server/package* ./server/pnpm* /tmp/create-dep-cache/server/
|
||||
COPY ./open-api/typescript-sdk/package* ./open-api/typescript-sdk/pnpm* /tmp/create-dep-cache/open-api/typescript-sdk/
|
||||
WORKDIR /tmp/create-dep-cache
|
||||
RUN pnpm fetch && rm -rf /tmp/create-dep-cache && chmod -R o+rw /buildcache
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
ENV PATH="${PATH}:/usr/src/app/server/bin" \
|
||||
IMMICH_ENV=development \
|
||||
@ -31,13 +38,6 @@ RUN usermod -aG sudo node && \
|
||||
RUN chown node:node -R /workspaces
|
||||
COPY --chown=node:node --chmod=755 ../.devcontainer/server/*.sh /immich-devcontainer/
|
||||
|
||||
|
||||
COPY ./package* ./pnpm* .pnpmfile.cjs /tmp/create-dep-cache/
|
||||
COPY ./web/package* ./web/pnpm* /tmp/create-dep-cache/web/
|
||||
COPY ./server/package* ./server/pnpm* /tmp/create-dep-cache/server/
|
||||
COPY ./open-api/typescript-sdk/package* ./open-api/typescript-sdk/pnpm* /tmp/create-dep-cache/open-api/typescript-sdk/
|
||||
WORKDIR /tmp/create-dep-cache
|
||||
RUN pnpm fetch && rm -rf /tmp/create-dep-cache
|
||||
WORKDIR /workspaces/immich
|
||||
|
||||
FROM dev-container-server AS dev-container-mobile
|
||||
@ -67,28 +67,38 @@ RUN mkdir -p ${FLUTTER_HOME} \
|
||||
&& rm flutter.tar.xz \
|
||||
&& chown -R node ${FLUTTER_HOME}
|
||||
|
||||
USER node
|
||||
RUN sudo apt-get update \
|
||||
&& wget -qO- https://dcm.dev/pgp-key.public | sudo gpg --dearmor -o /usr/share/keyrings/dcm.gpg \
|
||||
&& echo 'deb [signed-by=/usr/share/keyrings/dcm.gpg arch=amd64] https://dcm.dev/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list \
|
||||
&& sudo apt-get update \
|
||||
&& sudo apt-get install dcm -y
|
||||
|
||||
RUN apt-get update \
|
||||
&& wget -qO- https://dcm.dev/pgp-key.public | gpg --dearmor -o /usr/share/keyrings/dcm.gpg \
|
||||
&& echo 'deb [signed-by=/usr/share/keyrings/dcm.gpg arch=amd64] https://dcm.dev/debian stable main' | tee /etc/apt/sources.list.d/dart_stable.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install dcm -y
|
||||
|
||||
COPY --chmod=755 ../.devcontainer/mobile/container-mobile-post-create.sh /immich-devcontainer/container-mobile-post-create.sh
|
||||
|
||||
RUN dart --disable-analytics
|
||||
|
||||
# production-builder-base image
|
||||
FROM ghcr.io/immich-app/base-server-dev:202507291116@sha256:e38543bdd77a02ed156cd9175ed11e9c16dccf48c418d46ecda48ce684de456a AS prod-builder-base
|
||||
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
|
||||
CI=1 \
|
||||
COREPACK_HOME=/tmp
|
||||
|
||||
RUN npm install --global corepack@latest && \
|
||||
corepack enable pnpm
|
||||
|
||||
# server production build
|
||||
FROM dev AS server-prod
|
||||
FROM prod-builder-base AS server-prod
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
COPY ./package* ./pnpm* .pnpmfile.cjs ./
|
||||
COPY ./server ./server/
|
||||
# SHARP_IGNORE_GLOBAL_LIBVIPS because 'deploy' will always build sharp bindings from source
|
||||
RUN SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm --filter immich --frozen-lockfile build && \
|
||||
pnpm --filter immich --frozen-lockfile --prod --no-optional deploy /output/server-pruned
|
||||
|
||||
# web production build
|
||||
FROM dev AS web-prod
|
||||
FROM prod-builder-base AS web-prod
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
COPY ./package* ./pnpm* .pnpmfile.cjs ./
|
||||
@ -98,7 +108,7 @@ COPY ./open-api ./open-api/
|
||||
RUN SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm --filter @immich/sdk --filter immich-web --frozen-lockfile --force install && \
|
||||
pnpm --filter @immich/sdk --filter immich-web build
|
||||
|
||||
FROM dev AS cli-prod
|
||||
FROM prod-builder-base AS cli-prod
|
||||
|
||||
COPY ./package* ./pnpm* .pnpmfile.cjs ./
|
||||
COPY ./cli ./cli/
|
||||
@ -107,7 +117,7 @@ RUN pnpm --filter @immich/sdk --filter @immich/cli --frozen-lockfile install &&
|
||||
pnpm --filter @immich/sdk --filter @immich/cli build && \
|
||||
pnpm --filter @immich/cli --prod --no-optional deploy /output/cli-pruned
|
||||
|
||||
# prod build
|
||||
# prod base image
|
||||
FROM ghcr.io/immich-app/base-server-prod:202507291116@sha256:6e80f884c6e4f05cefe4b4fc4cc06a15bdb6ec9bd7b6e9eadf996a13b69494b6
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
@ -6,7 +6,7 @@ ENV CHOKIDAR_USEPOLLING=true \
|
||||
|
||||
RUN npm install --global corepack@latest && \
|
||||
corepack enable && corepack install -g pnpm && \
|
||||
apk add --no-cache tini make bash&& \
|
||||
apk add --no-cache tini make bash && \
|
||||
mkdir -p /buildcache/pnpm-store && \
|
||||
pnpm config set store-dir /buildcache/pnpm-store
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
"lint:fix": "npm run lint -- --fix",
|
||||
"format": "prettier --check .",
|
||||
"format:fix": "prettier --write . && npm run format:i18n",
|
||||
"format:i18n": "npx --yes sort-json ../i18n/*.json",
|
||||
"format:i18n": "pnpx sort-json ../i18n/*.json",
|
||||
"test": "vitest --run",
|
||||
"test:cov": "vitest --coverage",
|
||||
"test:watch": "vitest dev",
|
||||
|
Loading…
x
Reference in New Issue
Block a user