This commit is contained in:
Min Idzelis
2025-06-24 21:37:42 +00:00
parent 1923f1a887
commit 839db1e2c4
51 changed files with 41356 additions and 61718 deletions
+20 -10
View File
@@ -1,11 +1,15 @@
# dev build
FROM ghcr.io/immich-app/base-server-dev:202505131114@sha256:cf4507bbbf307e9b6d8ee9418993321f2b85867da8ce14d0a20ccaf9574cb995 AS dev
RUN apt-get install --no-install-recommends -yqq tini
ENV COREPACK_ENABLE_AUTO_PIN=0
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
RUN corepack enable && corepack install -g pnpm && apt-get install --no-install-recommends -yqq tini
RUN mkdir -p /pnpm/store && chmod 777 /pnpm/store && mkdir -p /usr/local/etc && echo "store-dir=/pnpm/store" >> /usr/local/etc/npmrc
WORKDIR /usr/src/app
COPY server/package.json server/package-lock.json ./
COPY server/package.json server/pnpm-lock.yaml server/pnpm-workspace.yaml ./
COPY server/patches ./patches
RUN npm ci && \
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install && \
# exiftool-vendored.pl, sharp-linux-x64 and sharp-linux-arm64 are the only ones we need
# they're marked as optional dependencies, so we need to copy them manually after pruning
rm -rf node_modules/@img/sharp-libvips* && \
@@ -69,11 +73,17 @@ COPY --chmod=777 ../.devcontainer/mobile/container-mobile-post-create.sh /immich
RUN dart --disable-analytics
COPY . /tmp/immich
WORKDIR /tmp/immich
RUN make install-sdk build-sdk install-cli install-e2e install-web install-server
WORKDIR /usr/src/app
RUN rm -rf /tmp/immich
FROM dev AS prod
COPY server .
RUN npm run build
RUN npm prune --omit=dev --omit=optional
RUN pnpm run build
RUN pnpm prune --prod --no-optional
COPY --from=dev /usr/src/app/node_modules/@img ./node_modules/@img
COPY --from=dev /usr/src/app/node_modules/exiftool-vendored.pl ./node_modules/exiftool-vendored.pl
@@ -82,16 +92,16 @@ FROM node:22.16.0-alpine3.20@sha256:2289fb1fba0f4633b08ec47b94a89c7e20b829fc5679
WORKDIR /usr/src/open-api/typescript-sdk
COPY open-api/typescript-sdk/package*.json open-api/typescript-sdk/tsconfig*.json ./
RUN npm ci
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
COPY open-api/typescript-sdk/ ./
RUN npm run build
RUN pnpm run build
WORKDIR /usr/src/app
COPY web/package*.json web/svelte.config.js ./
RUN npm ci
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
COPY web ./
COPY i18n ../i18n
RUN npm run build
RUN pnpm run build
# prod build
@@ -109,7 +119,7 @@ COPY server/resources resources
COPY server/package.json server/package-lock.json ./
COPY server/start*.sh ./
COPY "docker/scripts/get-cpus.sh" ./
RUN npm install -g @immich/cli && npm cache clean --force
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install -g @immich/cli
COPY LICENSE /licenses/LICENSE.txt
COPY LICENSE /LICENSE
ENV PATH="${PATH}:/usr/src/app/bin"
+1 -1
View File
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
node /usr/src/app/node_modules/.bin/nest start --debug "0.0.0.0:9230" --watch -- "$@"
pnpm exec nest start --debug "0.0.0.0:9230" --watch -- "$@"
-18931
View File
File diff suppressed because it is too large Load Diff
+8 -7
View File
@@ -32,8 +32,7 @@
"kysely:codegen": "npx kysely-codegen --include-pattern=\"(public|vectors).*\" --dialect postgres --url postgres://postgres:postgres@localhost/immich --log-level debug --out-file=./src/db.d.ts",
"sync:open-api": "node ./dist/bin/sync-open-api.js",
"sync:sql": "node ./dist/bin/sync-sql.js",
"email:dev": "email dev -p 3050 --dir src/emails",
"postinstall": "patch-package"
"email:dev": "email dev -p 3050 --dir src/emails"
},
"dependencies": {
"@nestjs/bullmq": "^11.0.1",
@@ -65,14 +64,14 @@
"bcrypt": "^6.0.0",
"body-parser": "^2.2.0",
"bullmq": "^5.51.0",
"chokidar": "^3.5.3",
"chokidar": "^4.0.3",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"compression": "^1.8.0",
"cookie": "^1.0.2",
"cookie-parser": "^1.4.7",
"cron": "^3.5.0",
"exiftool-vendored": "^28.3.1",
"exiftool-vendored": "^28.8.0",
"express": "^5.1.0",
"fast-glob": "^3.3.2",
"fluent-ffmpeg": "^2.1.2",
@@ -108,13 +107,14 @@
"sharp": "^0.34.2",
"sirv": "^3.0.0",
"socket.io": "^4.8.1",
"tailwindcss-preset-email": "^1.3.2",
"tailwindcss-preset-email": "^1.4.0",
"thumbhash": "^0.1.1",
"typeorm": "^0.3.17",
"ua-parser-js": "^2.0.0",
"validator": "^13.12.0"
},
"devDependencies": {
"canvas": "^3.1.0",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.8.0",
"@nestjs/cli": "^11.0.2",
@@ -156,7 +156,6 @@
"mock-fs": "^5.2.0",
"node-addon-api": "^8.3.1",
"node-gyp": "^11.2.0",
"patch-package": "^8.0.0",
"pngjs": "^7.0.0",
"prettier": "^3.0.2",
"prettier-plugin-organize-imports": "^4.0.0",
@@ -164,6 +163,7 @@
"source-map-support": "^0.5.21",
"sql-formatter": "^15.0.0",
"supertest": "^7.1.0",
"tailwindcss": "^3.4.0",
"testcontainers": "^11.0.0",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.3.3",
@@ -178,5 +178,6 @@
},
"overrides": {
"sharp": "^0.34.2"
}
},
"packageManager": "pnpm@10.12.3+sha512.467df2c586056165580ad6dfb54ceaad94c5a30f80893ebdec5a44c5aa73c205ae4a5bb9d5ed6bb84ea7c249ece786642bbb49d06a307df218d03da41c317417"
}
@@ -1,7 +1,7 @@
diff --git a/node_modules/postgres/cf/src/connection.js b/node_modules/postgres/cf/src/connection.js
index ee8b1e6..acf4566 100644
--- a/node_modules/postgres/cf/src/connection.js
+++ b/node_modules/postgres/cf/src/connection.js
diff --git a/cf/src/connection.js b/cf/src/connection.js
index ee8b1e69055bef090d322a66c7d792b5b502f47a..acf45662b35a8d01fa0d198faf6337d9f6808f3f 100644
--- a/cf/src/connection.js
+++ b/cf/src/connection.js
@@ -387,8 +387,10 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
}
@@ -14,10 +14,10 @@ index ee8b1e6..acf4566 100644
query: { value: query.string, enumerable: options.debug },
parameters: { value: query.parameters, enumerable: options.debug },
args: { value: query.args, enumerable: options.debug },
diff --git a/node_modules/postgres/cjs/src/connection.js b/node_modules/postgres/cjs/src/connection.js
index f7f58d1..b7f2d65 100644
--- a/node_modules/postgres/cjs/src/connection.js
+++ b/node_modules/postgres/cjs/src/connection.js
diff --git a/cjs/src/connection.js b/cjs/src/connection.js
index f7f58d147f344cb7f2420c2bd24c6b7917162033..b7f2d657c9e1d5fbc7ce4735f61abae972959b1e 100644
--- a/cjs/src/connection.js
+++ b/cjs/src/connection.js
@@ -385,8 +385,10 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
}
@@ -30,10 +30,10 @@ index f7f58d1..b7f2d65 100644
query: { value: query.string, enumerable: options.debug },
parameters: { value: query.parameters, enumerable: options.debug },
args: { value: query.args, enumerable: options.debug },
diff --git a/node_modules/postgres/src/connection.js b/node_modules/postgres/src/connection.js
index 97cc97e..26f508e 100644
--- a/node_modules/postgres/src/connection.js
+++ b/node_modules/postgres/src/connection.js
diff --git a/src/connection.js b/src/connection.js
index 97cc97e1576d6c75f958c66e9cecbf8cd11ed450..26f508e2de12f09f27838aca8d88fa4721fe6677 100644
--- a/src/connection.js
+++ b/src/connection.js
@@ -385,8 +385,10 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
}
+12102
View File
File diff suppressed because it is too large Load Diff
+8
View File
@@ -0,0 +1,8 @@
ignoredBuiltDependencies:
- '@tailwindcss/oxide'
- es5-ext
- esbuild
onlyBuiltDependencies:
- canvas
- sharp
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import archiver from 'archiver';
import chokidar, { WatchOptions } from 'chokidar';
import chokidar, { ChokidarOptions } from 'chokidar';
import { escapePath, glob, globStream } from 'fast-glob';
import { constants, createReadStream, createWriteStream, existsSync, mkdirSync } from 'node:fs';
import fs from 'node:fs/promises';
@@ -219,14 +219,14 @@ export class StorageRepository {
}
}
watch(paths: string[], options: WatchOptions, events: Partial<WatchEvents>) {
watch(paths: string[], options: ChokidarOptions, events: Partial<WatchEvents>) {
const watcher = chokidar.watch(paths, options);
watcher.on('ready', () => events.onReady?.());
watcher.on('add', (path) => events.onAdd?.(path));
watcher.on('change', (path) => events.onChange?.(path));
watcher.on('unlink', (path) => events.onUnlink?.(path));
watcher.on('error', (error) => events.onError?.(error));
watcher.on('error', (error) => events.onError?.(error as Error));
return () => watcher.close();
}
@@ -1,4 +1,4 @@
import { WatchOptions } from 'chokidar';
import { ChokidarOptions } from 'chokidar';
import { StorageCore } from 'src/cores/storage.core';
import { StorageRepository, WatchEvents } from 'src/repositories/storage.repository';
import { RepositoryInterface } from 'src/types';
@@ -11,7 +11,7 @@ interface MockWatcherOptions {
export const makeMockWatcher =
({ items, close }: MockWatcherOptions) =>
(paths: string[], options: WatchOptions, events: Partial<WatchEvents>) => {
(paths: string[], options: ChokidarOptions, events: Partial<WatchEvents>) => {
events.onReady?.();
for (const item of items || []) {
switch (item.event) {
@@ -29,6 +29,7 @@ export const makeMockWatcher =
}
case 'error': {
events.onError?.(new Error(item.value));
break;
}
}
}