Skip to content

Commit e288f6b

Browse files
committed
Review comments, minor tweaks
1 parent 687e99c commit e288f6b

File tree

10 files changed

+71
-114
lines changed

10 files changed

+71
-114
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ jobs:
233233
run: pnpm install --frozen-lockfile && pnpm build
234234
working-directory: ./open-api/typescript-sdk
235235
- name: Run npm install
236-
run: SKIP_SHARP_FILTERING=true pnpm install --frozen-lockfile
236+
run: pnpm install --frozen-lockfile
237237
- name: Run tsc
238238
run: pnpm check:typescript
239239
if: ${{ !cancelled() }}
@@ -341,7 +341,7 @@ jobs:
341341
cache: 'pnpm'
342342
cache-dependency-path: '**/pnpm-lock.yaml'
343343
- name: Run pnpm install
344-
run: SKIP_SHARP_FILTERING=true pnpm install --frozen-lockfile
344+
run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm install --frozen-lockfile
345345
- name: Run medium tests
346346
run: pnpm test:medium
347347
if: ${{ !cancelled() }}
@@ -565,7 +565,7 @@ jobs:
565565
cache: 'pnpm'
566566
cache-dependency-path: '**/pnpm-lock.yaml'
567567
- name: Install server dependencies
568-
run: SKIP_SHARP_FILTERING=true pnpm --filter immich install --frozen-lockfile
568+
run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm --filter immich install --frozen-lockfile
569569
- name: Build the app
570570
run: pnpm --filter immich build
571571
- name: Run API generation
@@ -619,7 +619,7 @@ jobs:
619619
cache: 'pnpm'
620620
cache-dependency-path: '**/pnpm-lock.yaml'
621621
- name: Install server dependencies
622-
run: SKIP_SHARP_FILTERING=true pnpm install --frozen-lockfile
622+
run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm install --frozen-lockfile
623623
- name: Build the app
624624
run: pnpm build
625625
- name: Run existing migrations

.pnpmfile.cjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module.exports = {
33
readPackage: (pkg) => {
44
if (pkg.name && pkg.name === "exiftool-vendored") {
55
if (pkg.optionalDependencies["exiftool-vendored.pl"]) {
6+
// make exiftool-vendored.pl a regular dependency
67
pkg.dependencies["exiftool-vendored.pl"] =
78
pkg.optionalDependencies["exiftool-vendored.pl"];
89
delete pkg.optionalDependencies["exiftool-vendored.pl"];
@@ -13,7 +14,10 @@ module.exports = {
1314
(dep) => dep.startsWith("@img")
1415
);
1516
for (const dep of optionalDeps) {
16-
if (dep.includes("musl") || process.env.SKIP_SHARP_FILTERING) {
17+
// remove all optionalDepdencies from sharp (they will be compiled from source), except:
18+
// include the precompiled musl version of sharp, for web/Dockerfile
19+
// include precompiled linux-x64 version of sharp, for server/Dockerfile, stage: web-prod
20+
if (dep.includes("musl") || dep.includes("linux-x64")) {
1721
continue;
1822
}
1923
delete pkg.optionalDependencies[dep];

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dev-update:
88
@trap 'make dev-down' EXIT; COMPOSE_BAKE=true docker compose -f ./docker/docker-compose.dev.yml up --build -V --remove-orphans
99

1010
dev-scale:
11-
@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
11+
@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
1212

1313
dev-docs:
1414
npm --prefix docs run start

docker/docker-compose.dev.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ services:
1717
immich-server:
1818
container_name: immich_server
1919
command: ['immich-dev']
20-
# entrypoint: ["/bin/sh"]
21-
# command: ["-c", "sleep infinity"]
2220
image: immich-server-dev:latest
2321
# extends:
2422
# file: hwaccel.transcoding.yml

open-api/bin/generate-open-api.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function dart {
1515
patch --no-backup-if-mismatch -u api.mustache <api.mustache.patch
1616

1717
cd ../../
18-
npx --yes @openapitools/openapi-generator-cli generate -g dart -i ./immich-openapi-specs.json -o ../mobile/openapi -t ./templates/mobile
18+
pnpx @openapitools/openapi-generator-cli generate -g dart -i ./immich-openapi-specs.json -o ../mobile/openapi -t ./templates/mobile
1919

2020
# Post generate patches
2121
patch --no-backup-if-mismatch -u ../mobile/openapi/lib/api_client.dart <./patch/api_client.dart.patch
@@ -27,16 +27,15 @@ function dart {
2727
}
2828

2929
function typescript {
30-
npx --yes oazapfts --optimistic --argumentStyle=object --useEnumType immich-openapi-specs.json typescript-sdk/src/fetch-client.ts
30+
pnpx oazapfts --optimistic --argumentStyle=object --useEnumType immich-openapi-specs.json typescript-sdk/src/fetch-client.ts
3131
pnpm --filter @immich/sdk install --frozen-lockfile
3232
pnpm --filter @immich/sdk build
3333
}
3434

3535
# requires server to be built
3636
(
37-
cd ..
38-
pnpm --filter immich install
39-
pnpm --filter immich build
37+
cd ..
38+
SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm --filter immich build
4039
pnpm --filter immich sync:open-api
4140
)
4241

pnpm-lock.yaml

Lines changed: 23 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ packages:
66
- server
77
- web
88
- .github
9-
10-
119
ignoredBuiltDependencies:
1210
- '@nestjs/core'
1311
- '@scarf/scarf'
@@ -24,28 +22,12 @@ ignoredBuiltDependencies:
2422
- protobufjs
2523
- ssh2
2624
- utimes
27-
2825
onlyBuiltDependencies:
2926
- sharp
3027
- '@tailwindcss/oxide'
31-
3228
overrides:
3329
canvas: 2.11.2
3430
sharp: ^0.34.2
35-
'@img/sharp-darwin-arm64': '-'
36-
'@img/sharp-darwin-x64': '-'
37-
'@img/sharp-libvips-darwin-arm64': '-'
38-
'@img/sharp-libvips-darwin-x64': '-'
39-
'@img/sharp-libvips-linux-ppc64': '-'
40-
'@img/sharp-libvips-linux-s390x': '-'
41-
'@img/sharp-libvips-linuxmusl-arm64': '-'
42-
'@img/sharp-linux-s390x': '-'
43-
'@img/sharp-linuxmusl-arm64': '-'
44-
'@img/sharp-wasm32': '-'
45-
'@img/sharp-win32-arm64': '-'
46-
'@img/sharp-win32-ia32': '-'
47-
'@img/sharp-win32-x64': '-'
48-
4931
packageExtensions:
5032
nestjs-kysely:
5133
dependencies:
@@ -65,13 +47,11 @@ packageExtensions:
6547
node-gyp: '*'
6648
'@immich/ui':
6749
dependencies:
68-
tailwindcss: ^4.1.11
50+
tailwindcss: '>=4.1'
6951
tailwind-variants:
7052
dependencies:
71-
tailwindcss: ^4.1.11
72-
53+
tailwindcss: '>=4.1'
7354
dedupePeerDependents: false
74-
packageImportMethod: hardlink
7555
preferWorkspacePackages: true
7656
injectWorkspacePackages: true
7757
shamefullyHoist: false

server/Dockerfile

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@ ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
55
CI=1 \
66
COREPACK_HOME=/tmp
77

8-
WORKDIR /usr/src/app
9-
108
RUN npm install --global corepack@latest && \
119
corepack enable pnpm && \
12-
pnpm config set store-dir /buildcache/pnpm-store
10+
echo "store-dir=/buildcache/pnpm-store" >> /usr/local/etc/npmrc && \
11+
echo "devdir=/buildcache/node-gyp" >> /usr/local/etc/npmrc
12+
13+
COPY ./package* ./pnpm* .pnpmfile.cjs /tmp/create-dep-cache/
14+
COPY ./web/package* ./web/pnpm* /tmp/create-dep-cache/web/
15+
COPY ./server/package* ./server/pnpm* /tmp/create-dep-cache/server/
16+
COPY ./open-api/typescript-sdk/package* ./open-api/typescript-sdk/pnpm* /tmp/create-dep-cache/open-api/typescript-sdk/
17+
WORKDIR /tmp/create-dep-cache
18+
RUN pnpm fetch && rm -rf /tmp/create-dep-cache && chmod -R o+rw /buildcache
19+
WORKDIR /usr/src/app
1320

1421
ENV PATH="${PATH}:/usr/src/app/server/bin" \
1522
IMMICH_ENV=development \
@@ -31,13 +38,6 @@ RUN usermod -aG sudo node && \
3138
RUN chown node:node -R /workspaces
3239
COPY --chown=node:node --chmod=755 ../.devcontainer/server/*.sh /immich-devcontainer/
3340

34-
35-
COPY ./package* ./pnpm* .pnpmfile.cjs /tmp/create-dep-cache/
36-
COPY ./web/package* ./web/pnpm* /tmp/create-dep-cache/web/
37-
COPY ./server/package* ./server/pnpm* /tmp/create-dep-cache/server/
38-
COPY ./open-api/typescript-sdk/package* ./open-api/typescript-sdk/pnpm* /tmp/create-dep-cache/open-api/typescript-sdk/
39-
WORKDIR /tmp/create-dep-cache
40-
RUN pnpm fetch && rm -rf /tmp/create-dep-cache
4141
WORKDIR /workspaces/immich
4242

4343
FROM dev-container-server AS dev-container-mobile
@@ -67,28 +67,38 @@ RUN mkdir -p ${FLUTTER_HOME} \
6767
&& rm flutter.tar.xz \
6868
&& chown -R node ${FLUTTER_HOME}
6969

70-
USER node
71-
RUN sudo apt-get update \
72-
&& wget -qO- https://dcm.dev/pgp-key.public | sudo gpg --dearmor -o /usr/share/keyrings/dcm.gpg \
73-
&& 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 \
74-
&& sudo apt-get update \
75-
&& sudo apt-get install dcm -y
70+
71+
RUN apt-get update \
72+
&& wget -qO- https://dcm.dev/pgp-key.public | gpg --dearmor -o /usr/share/keyrings/dcm.gpg \
73+
&& 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 \
74+
&& apt-get update \
75+
&& apt-get install dcm -y
7676

7777
COPY --chmod=755 ../.devcontainer/mobile/container-mobile-post-create.sh /immich-devcontainer/container-mobile-post-create.sh
7878

7979
RUN dart --disable-analytics
8080

81+
# production-builder-base image
82+
FROM ghcr.io/immich-app/base-server-dev:202507291116@sha256:e38543bdd77a02ed156cd9175ed11e9c16dccf48c418d46ecda48ce684de456a AS prod-builder-base
83+
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
84+
CI=1 \
85+
COREPACK_HOME=/tmp
86+
87+
RUN npm install --global corepack@latest && \
88+
corepack enable pnpm
89+
8190
# server production build
82-
FROM dev AS server-prod
91+
FROM prod-builder-base AS server-prod
8392

8493
WORKDIR /usr/src/app
8594
COPY ./package* ./pnpm* .pnpmfile.cjs ./
8695
COPY ./server ./server/
96+
# SHARP_IGNORE_GLOBAL_LIBVIPS because 'deploy' will always build sharp bindings from source
8797
RUN SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm --filter immich --frozen-lockfile build && \
8898
pnpm --filter immich --frozen-lockfile --prod --no-optional deploy /output/server-pruned
8999

90100
# web production build
91-
FROM dev AS web-prod
101+
FROM prod-builder-base AS web-prod
92102

93103
WORKDIR /usr/src/app
94104
COPY ./package* ./pnpm* .pnpmfile.cjs ./
@@ -98,7 +108,7 @@ COPY ./open-api ./open-api/
98108
RUN SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm --filter @immich/sdk --filter immich-web --frozen-lockfile --force install && \
99109
pnpm --filter @immich/sdk --filter immich-web build
100110

101-
FROM dev AS cli-prod
111+
FROM prod-builder-base AS cli-prod
102112

103113
COPY ./package* ./pnpm* .pnpmfile.cjs ./
104114
COPY ./cli ./cli/
@@ -107,7 +117,7 @@ RUN pnpm --filter @immich/sdk --filter @immich/cli --frozen-lockfile install &&
107117
pnpm --filter @immich/sdk --filter @immich/cli build && \
108118
pnpm --filter @immich/cli --prod --no-optional deploy /output/cli-pruned
109119

110-
# prod build
120+
# prod base image
111121
FROM ghcr.io/immich-app/base-server-prod:202507291116@sha256:6e80f884c6e4f05cefe4b4fc4cc06a15bdb6ec9bd7b6e9eadf996a13b69494b6
112122

113123
WORKDIR /usr/src/app

0 commit comments

Comments
 (0)