mirror of
				https://github.com/immich-app/immich.git
				synced 2025-10-26 04:33:39 +09:00 
			
		
		
		
	chore: dockerfile layout changes (#19673)
	
		
			
	
		
	
	
		
	
		
			Some checks are pending
		
		
	
	
		
			
				
	
				CodeQL / Analyze (javascript) (push) Waiting to run
				
			
		
			
				
	
				CodeQL / Analyze (python) (push) Waiting to run
				
			
		
			
				
	
				Docker / pre-job (push) Waiting to run
				
			
		
			
				
	
				Docker / Re-Tag ML () (push) Blocked by required conditions
				
			
		
			
				
	
				Docker / Re-Tag ML (-armnn) (push) Blocked by required conditions
				
			
		
			
				
	
				Docker / Re-Tag ML (-cuda) (push) Blocked by required conditions
				
			
		
			
				
	
				Docker / Re-Tag ML (-openvino) (push) Blocked by required conditions
				
			
		
			
				
	
				Docker / Re-Tag ML (-rknn) (push) Blocked by required conditions
				
			
		
			
				
	
				Docker / Re-Tag ML (-rocm) (push) Blocked by required conditions
				
			
		
			
				
	
				Docker / Re-Tag Server () (push) Blocked by required conditions
				
			
		
			
				
	
				Docker / Build and Push ML (armnn, linux/arm64, -armnn) (push) Blocked by required conditions
				
			
		
			
				
	
				Docker / Build and Push ML (cpu, ) (push) Blocked by required conditions
				
			
		
			
				
	
				Docker / Build and Push ML (cuda, linux/amd64, -cuda) (push) Blocked by required conditions
				
			
		
			
				
	
				Docker / Build and Push ML (openvino, linux/amd64, -openvino) (push) Blocked by required conditions
				
			
		
			
				
	
				Docker / Build and Push ML (rknn, linux/arm64, -rknn) (push) Blocked by required conditions
				
			
		
			
				
	
				Docker / Build and Push ML (rocm, linux/amd64, {"linux/amd64": "mich"}, -rocm) (push) Blocked by required conditions
				
			
		
			
				
	
				Docker / Build and Push Server (push) Blocked by required conditions
				
			
		
			
				
	
				Docker / Docker Build & Push Server Success (push) Blocked by required conditions
				
			
		
			
				
	
				Docker / Docker Build & Push ML Success (push) Blocked by required conditions
				
			
		
			
				
	
				Docs build / pre-job (push) Waiting to run
				
			
		
			
				
	
				Docs build / Docs Build (push) Blocked by required conditions
				
			
		
			
				
	
				Static Code Analysis / pre-job (push) Waiting to run
				
			
		
			
				
	
				Static Code Analysis / Run Dart Code Analysis (push) Blocked by required conditions
				
			
		
			
				
	
				Static Code Analysis / zizmor (push) Waiting to run
				
			
		
			
				
	
				Test / pre-job (push) Waiting to run
				
			
		
			
				
	
				Test / Test & Lint Server (push) Blocked by required conditions
				
			
		
			
				
	
				Test / Unit Test CLI (push) Blocked by required conditions
				
			
		
			
				
	
				Test / Unit Test CLI (Windows) (push) Blocked by required conditions
				
			
		
			
				
	
				Test / Lint Web (push) Blocked by required conditions
				
			
		
			
				
	
				Test / Test Web (push) Blocked by required conditions
				
			
		
			
				
	
				Test / Test i18n (push) Blocked by required conditions
				
			
		
			
				
	
				Test / End-to-End Lint (push) Blocked by required conditions
				
			
		
			
				
	
				Test / Medium Tests (Server) (push) Blocked by required conditions
				
			
		
			
				
	
				Test / End-to-End Tests (Server & CLI) (ubuntu-24.04-arm) (push) Blocked by required conditions
				
			
		
			
				
	
				Test / End-to-End Tests (Server & CLI) (ubuntu-latest) (push) Blocked by required conditions
				
			
		
			
				
	
				Test / End-to-End Tests (Web) (ubuntu-24.04-arm) (push) Blocked by required conditions
				
			
		
			
				
	
				Test / End-to-End Tests (Web) (ubuntu-latest) (push) Blocked by required conditions
				
			
		
			
				
	
				Test / End-to-End Tests Success (push) Blocked by required conditions
				
			
		
			
				
	
				Test / Unit Test Mobile (push) Blocked by required conditions
				
			
		
			
				
	
				Test / Unit Test ML (push) Blocked by required conditions
				
			
		
			
				
	
				Test / .github Files Formatting (push) Blocked by required conditions
				
			
		
			
				
	
				Test / ShellCheck (push) Waiting to run
				
			
		
			
				
	
				Test / OpenAPI Clients (push) Waiting to run
				
			
		
			
				
	
				Test / SQL Schema Checks (push) Waiting to run
				
			
		
		
	
	
				
					
				
			
		
			Some checks are pending
		
		
	
	CodeQL / Analyze (javascript) (push) Waiting to run
				
			CodeQL / Analyze (python) (push) Waiting to run
				
			Docker / pre-job (push) Waiting to run
				
			Docker / Re-Tag ML () (push) Blocked by required conditions
				
			Docker / Re-Tag ML (-armnn) (push) Blocked by required conditions
				
			Docker / Re-Tag ML (-cuda) (push) Blocked by required conditions
				
			Docker / Re-Tag ML (-openvino) (push) Blocked by required conditions
				
			Docker / Re-Tag ML (-rknn) (push) Blocked by required conditions
				
			Docker / Re-Tag ML (-rocm) (push) Blocked by required conditions
				
			Docker / Re-Tag Server () (push) Blocked by required conditions
				
			Docker / Build and Push ML (armnn, linux/arm64, -armnn) (push) Blocked by required conditions
				
			Docker / Build and Push ML (cpu, ) (push) Blocked by required conditions
				
			Docker / Build and Push ML (cuda, linux/amd64, -cuda) (push) Blocked by required conditions
				
			Docker / Build and Push ML (openvino, linux/amd64, -openvino) (push) Blocked by required conditions
				
			Docker / Build and Push ML (rknn, linux/arm64, -rknn) (push) Blocked by required conditions
				
			Docker / Build and Push ML (rocm, linux/amd64, {"linux/amd64": "mich"}, -rocm) (push) Blocked by required conditions
				
			Docker / Build and Push Server (push) Blocked by required conditions
				
			Docker / Docker Build & Push Server Success (push) Blocked by required conditions
				
			Docker / Docker Build & Push ML Success (push) Blocked by required conditions
				
			Docs build / pre-job (push) Waiting to run
				
			Docs build / Docs Build (push) Blocked by required conditions
				
			Static Code Analysis / pre-job (push) Waiting to run
				
			Static Code Analysis / Run Dart Code Analysis (push) Blocked by required conditions
				
			Static Code Analysis / zizmor (push) Waiting to run
				
			Test / pre-job (push) Waiting to run
				
			Test / Test & Lint Server (push) Blocked by required conditions
				
			Test / Unit Test CLI (push) Blocked by required conditions
				
			Test / Unit Test CLI (Windows) (push) Blocked by required conditions
				
			Test / Lint Web (push) Blocked by required conditions
				
			Test / Test Web (push) Blocked by required conditions
				
			Test / Test i18n (push) Blocked by required conditions
				
			Test / End-to-End Lint (push) Blocked by required conditions
				
			Test / Medium Tests (Server) (push) Blocked by required conditions
				
			Test / End-to-End Tests (Server & CLI) (ubuntu-24.04-arm) (push) Blocked by required conditions
				
			Test / End-to-End Tests (Server & CLI) (ubuntu-latest) (push) Blocked by required conditions
				
			Test / End-to-End Tests (Web) (ubuntu-24.04-arm) (push) Blocked by required conditions
				
			Test / End-to-End Tests (Web) (ubuntu-latest) (push) Blocked by required conditions
				
			Test / End-to-End Tests Success (push) Blocked by required conditions
				
			Test / Unit Test Mobile (push) Blocked by required conditions
				
			Test / Unit Test ML (push) Blocked by required conditions
				
			Test / .github Files Formatting (push) Blocked by required conditions
				
			Test / ShellCheck (push) Waiting to run
				
			Test / OpenAPI Clients (push) Waiting to run
				
			Test / SQL Schema Checks (push) Waiting to run
				
			Dockerfile layout changes Fix up web path feat: update server env vars for layout
This commit is contained in:
		| @@ -1,41 +1,41 @@ | ||||
| .vscode/ | ||||
| .github/ | ||||
| .git/ | ||||
| .env* | ||||
| *.log | ||||
| *.tmp | ||||
| *.temp | ||||
|  | ||||
| **/Dockerfile | ||||
| **/node_modules/ | ||||
| **/.pnpm-store/ | ||||
| **/dist/ | ||||
| **/coverage/ | ||||
| **/build/ | ||||
|  | ||||
| design/ | ||||
| docker/ | ||||
| Dockerfile | ||||
| !docker/scripts | ||||
|  | ||||
| docs/ | ||||
| !docs/package.json | ||||
| !docs/package-lock.json | ||||
|  | ||||
| e2e/ | ||||
| !e2e/package.json | ||||
| !e2e/package-lock.json | ||||
|  | ||||
| fastlane/ | ||||
| machine-learning/ | ||||
| misc/ | ||||
| mobile/ | ||||
|  | ||||
| cli/coverage/ | ||||
| cli/dist/ | ||||
| cli/node_modules/ | ||||
| cli/Dockerfile | ||||
|  | ||||
| open-api/typescript-sdk/build/ | ||||
| open-api/typescript-sdk/node_modules/ | ||||
| !open-api/typescript-sdk/package.json | ||||
| !open-api/typescript-sdk/package-lock.json | ||||
|  | ||||
| server/coverage/ | ||||
| server/node_modules/ | ||||
| server/upload/ | ||||
| server/src/queries | ||||
| server/dist/ | ||||
| server/www/ | ||||
| server/Dockerfile | ||||
|  | ||||
| web/node_modules/ | ||||
| web/coverage/ | ||||
| web/.svelte-kit | ||||
| web/build/ | ||||
| web/.env | ||||
| web/Dockerfile | ||||
|   | ||||
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -24,3 +24,4 @@ mobile/android/fastlane/report.xml | ||||
| mobile/ios/fastlane/report.xml | ||||
|  | ||||
| vite.config.js.timestamp-* | ||||
| .pnpm-store | ||||
|   | ||||
| @@ -27,11 +27,11 @@ services: | ||||
|       target: dev | ||||
|     restart: unless-stopped | ||||
|     volumes: | ||||
|       - ../server:/usr/src/app | ||||
|       - ../open-api:/usr/src/open-api | ||||
|       - ../server:/usr/src/app/server | ||||
|       - ../open-api:/usr/src/app/open-api | ||||
|       - ${UPLOAD_LOCATION}/photos:/usr/src/app/upload | ||||
|       - ${UPLOAD_LOCATION}/photos/upload:/usr/src/app/upload/upload | ||||
|       - /usr/src/app/node_modules | ||||
|       - /usr/src/app/server/node_modules | ||||
|       - /etc/localtime:/etc/localtime:ro | ||||
|     env_file: | ||||
|       - .env | ||||
| @@ -69,7 +69,8 @@ services: | ||||
|     # Needed for rootless docker setup, see https://github.com/moby/moby/issues/45919 | ||||
|     # user: 0:0 | ||||
|     build: | ||||
|       context: ../web | ||||
|       context: ../ | ||||
|       dockerfile: web/Dockerfile | ||||
|     command: ['immich-web'] | ||||
|     env_file: | ||||
|       - .env | ||||
| @@ -77,11 +78,11 @@ services: | ||||
|       - 3000:3000 | ||||
|       - 24678:24678 | ||||
|     volumes: | ||||
|       - ../web:/usr/src/app | ||||
|       - ../i18n:/usr/src/i18n | ||||
|       - ../open-api/:/usr/src/open-api/ | ||||
|       - ../web:/usr/src/app/web | ||||
|       - ../i18n:/usr/src/app/i18n | ||||
|       - ../open-api/:/usr/src/app/open-api/ | ||||
|       # - ../../ui:/usr/ui | ||||
|       - /usr/src/app/node_modules | ||||
|       - /usr/src/app/web/node_modules | ||||
|     ulimits: | ||||
|       nofile: | ||||
|         soft: 1048576 | ||||
|   | ||||
| @@ -2,25 +2,26 @@ | ||||
| FROM ghcr.io/immich-app/base-server-dev:202507162011@sha256:85d4230c2208646bd6c528db41b2213d780b11b7a311397ca6a2aaba7cf697c8 AS dev | ||||
|  | ||||
| WORKDIR /usr/src/app | ||||
| COPY server/package.json server/package-lock.json ./ | ||||
| COPY ./server/package* ./server/ | ||||
| WORKDIR /usr/src/app/server | ||||
| RUN npm ci && \ | ||||
|     # 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* && \ | ||||
|     rm -rf node_modules/@img/sharp-linuxmusl-x64 | ||||
| ENV PATH="${PATH}:/usr/src/app/bin" \ | ||||
|     IMMICH_ENV=development \ | ||||
|     NVIDIA_DRIVER_CAPABILITIES=all \ | ||||
|     NVIDIA_VISIBLE_DEVICES=all | ||||
| ENTRYPOINT ["tini", "--", "/bin/sh", "-c"] | ||||
|   # 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* && \ | ||||
|   rm -rf node_modules/@img/sharp-linuxmusl-x64 | ||||
| ENV PATH="${PATH}:/usr/src/app/server/bin" \ | ||||
|   IMMICH_ENV=development \ | ||||
|   NVIDIA_DRIVER_CAPABILITIES=all \ | ||||
|   NVIDIA_VISIBLE_DEVICES=all | ||||
| ENTRYPOINT ["tini", "--", "/bin/bash", "-c"] | ||||
|  | ||||
| FROM dev AS dev-container-server | ||||
|  | ||||
| RUN rm -rf /usr/src/app | ||||
| RUN apt-get update && \ | ||||
|     apt-get install sudo inetutils-ping openjdk-11-jre-headless \ | ||||
|     vim nano \ | ||||
|     -y --no-install-recommends --fix-missing | ||||
|   apt-get install sudo inetutils-ping openjdk-11-jre-headless \ | ||||
|   vim nano \ | ||||
|   -y --no-install-recommends --fix-missing | ||||
|  | ||||
| RUN usermod -aG sudo node | ||||
| RUN echo "node ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | ||||
| @@ -38,14 +39,14 @@ FROM dev-container-server AS dev-container-mobile | ||||
| USER root | ||||
| # Enable multiarch for arm64 if necessary | ||||
| RUN if [ "$(dpkg --print-architecture)" = "arm64" ]; then \ | ||||
|     dpkg --add-architecture amd64 && \ | ||||
|     apt-get update && \ | ||||
|     apt-get install -y --no-install-recommends \ | ||||
|         qemu-user-static \ | ||||
|         libc6:amd64 \ | ||||
|         libstdc++6:amd64 \ | ||||
|         libgcc1:amd64; \ | ||||
|     fi | ||||
|   dpkg --add-architecture amd64 && \ | ||||
|   apt-get update && \ | ||||
|   apt-get install -y --no-install-recommends \ | ||||
|   qemu-user-static \ | ||||
|   libc6:amd64 \ | ||||
|   libstdc++6:amd64 \ | ||||
|   libgcc1:amd64; \ | ||||
|   fi | ||||
|  | ||||
| # Flutter SDK | ||||
| # https://flutter.dev/docs/development/tools/sdk/releases?tab=linux | ||||
| @@ -77,43 +78,42 @@ FROM dev AS prod | ||||
| COPY server . | ||||
| RUN npm run build | ||||
| RUN npm prune --omit=dev --omit=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 | ||||
| COPY --from=dev /usr/src/app/server/node_modules/@img ./node_modules/@img | ||||
| COPY --from=dev /usr/src/app/server/node_modules/exiftool-vendored.pl ./node_modules/exiftool-vendored.pl | ||||
|  | ||||
| # web build | ||||
| FROM node:22.16.0-alpine3.20@sha256:2289fb1fba0f4633b08ec47b94a89c7e20b829fc5679f9b7b298eaa2f1ed8b7e AS web | ||||
|  | ||||
| WORKDIR /usr/src/open-api/typescript-sdk | ||||
| COPY open-api/typescript-sdk/package*.json open-api/typescript-sdk/tsconfig*.json ./ | ||||
| RUN npm ci | ||||
| COPY open-api/typescript-sdk/ ./ | ||||
| RUN npm run build | ||||
|  | ||||
| WORKDIR /usr/src/app | ||||
| COPY web/package*.json web/svelte.config.js ./ | ||||
| RUN npm ci | ||||
| COPY web ./ | ||||
| COPY i18n ../i18n | ||||
| RUN npm run build | ||||
| COPY ./web ./web/ | ||||
| COPY ./i18n ./i18n/ | ||||
| COPY ./open-api/typescript-sdk ./open-api/typescript-sdk/ | ||||
|  | ||||
| WORKDIR /usr/src/app/open-api/typescript-sdk | ||||
| RUN npm ci && npm run build | ||||
|  | ||||
| WORKDIR /usr/src/app/web | ||||
| RUN npm ci && npm run build | ||||
|  | ||||
| # prod build | ||||
| FROM ghcr.io/immich-app/base-server-prod:202507162011@sha256:636f3ddb6106628ef851d51c23f3fa2c6e4829390cc315b27b38c288c82b23a7 | ||||
|  | ||||
| WORKDIR /usr/src/app | ||||
| ENV NODE_ENV=production \ | ||||
|     NVIDIA_DRIVER_CAPABILITIES=all \ | ||||
|     NVIDIA_VISIBLE_DEVICES=all | ||||
| COPY --from=prod /usr/src/app/node_modules ./node_modules | ||||
| COPY --from=prod /usr/src/app/dist ./dist | ||||
| COPY --from=prod /usr/src/app/bin ./bin | ||||
| COPY --from=web /usr/src/app/build /build/www | ||||
| COPY server/resources resources | ||||
| COPY server/package.json server/package-lock.json ./ | ||||
| RUN npm install -g @immich/cli && npm cache clean --force | ||||
|   NVIDIA_DRIVER_CAPABILITIES=all \ | ||||
|   NVIDIA_VISIBLE_DEVICES=all | ||||
|  | ||||
| COPY --from=prod /usr/src/app/server/node_modules ./server/node_modules | ||||
| COPY --from=prod /usr/src/app/server/dist ./server/dist | ||||
| COPY --from=prod /usr/src/app/server/bin ./server/bin | ||||
| COPY --from=web /usr/src/app/web/build /build/www | ||||
| COPY ./server/resources ./server/resources | ||||
| COPY ./server/package.json server/package-lock.json ./ | ||||
| COPY LICENSE /licenses/LICENSE.txt | ||||
| COPY LICENSE /LICENSE | ||||
| ENV PATH="${PATH}:/usr/src/app/bin" | ||||
|  | ||||
| RUN npm install -g @immich/cli && npm cache clean --force | ||||
| ENV PATH="${PATH}:/usr/src/app/server/bin" | ||||
|  | ||||
| ARG BUILD_ID | ||||
| ARG BUILD_IMAGE | ||||
|   | ||||
| @@ -5,5 +5,5 @@ if [ "$IMMICH_ENV" != "development" ]; then | ||||
|   exit 1 | ||||
| fi | ||||
|  | ||||
| cd /usr/src/app || exit 1 | ||||
| node ./node_modules/.bin/nest start --debug "0.0.0.0:9230" --watch -- "$@" | ||||
| cd /usr/src/app/server || exit 1 | ||||
| npm exec nest start --debug "0.0.0.0:9230" --watch -- "$@" | ||||
|   | ||||
| @@ -8,7 +8,7 @@ else | ||||
|   echo "skipping libmimalloc - path not found $lib_path" | ||||
| fi | ||||
| export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/jellyfin-ffmpeg/lib" | ||||
| SERVER_HOME=/usr/src/app | ||||
| SERVER_HOME=/usr/src/app/server | ||||
|  | ||||
| read_file_and_export() { | ||||
| 	if [ -n "${!1}" ]; then | ||||
|   | ||||
| @@ -1,12 +1,17 @@ | ||||
| FROM node:22.16.0-alpine3.20@sha256:2289fb1fba0f4633b08ec47b94a89c7e20b829fc5679f9b7b298eaa2f1ed8b7e | ||||
|  | ||||
| RUN apk add --no-cache tini | ||||
| RUN apk add --no-cache tini bash | ||||
|  | ||||
| USER node | ||||
| WORKDIR /usr/src/app | ||||
| COPY --chown=node:node package*.json ./ | ||||
|  | ||||
| COPY --chown=node:node ./web/package* ./web/ | ||||
|  | ||||
| WORKDIR /usr/src/app/web | ||||
| RUN npm ci | ||||
|  | ||||
| ENV CHOKIDAR_USEPOLLING=true \ | ||||
|   PATH="${PATH}:/usr/src/app/bin" | ||||
|   PATH="${PATH}:/usr/src/app/web/bin" | ||||
| EXPOSE 24678 | ||||
| EXPOSE 3000 | ||||
| ENTRYPOINT ["/sbin/tini", "--", "/bin/sh", "-c"] | ||||
| ENTRYPOINT ["tini", "--", "/bin/bash", "-c"] | ||||
|   | ||||
| @@ -1,11 +1,11 @@ | ||||
| #!/usr/bin/env sh | ||||
|  | ||||
| TYPESCRIPT_SDK=/usr/src/open-api/typescript-sdk | ||||
| TYPESCRIPT_SDK=/usr/src/app/open-api/typescript-sdk | ||||
|  | ||||
| npm --prefix "$TYPESCRIPT_SDK" install | ||||
| npm --prefix "$TYPESCRIPT_SDK" run build | ||||
|  | ||||
| cd /usr/src/app || exit 1 | ||||
| cd /usr/src/app/web || exit 1 | ||||
|  | ||||
| COUNT=0 | ||||
| UPSTREAM="${IMMICH_SERVER_URL:-http://immich-server:2283/}" | ||||
| @@ -19,4 +19,4 @@ done | ||||
|  | ||||
| echo "Connected to $UPSTREAM" | ||||
|  | ||||
| node ./node_modules/.bin/vite dev --host 0.0.0.0 --port 3000 | ||||
| npx vite dev --host 0.0.0.0 --port 3000 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user