mirror of
https://github.com/immich-app/immich.git
synced 2025-11-25 07:45:17 -05:00
* feat: plugins * feat: table definition * feat: type and migration * feat: add repositories * feat: validate manifest with class-validator and load manifest info to database * feat: workflow/plugin controller/service layer * feat: implement workflow logic * feat: make trigger static * feat: dynamical instantiate plugin instances * fix: access control and helper script * feat: it works * chore: simplify * refactor: refactor and use queue for workflow execution * refactor: remove unsused property in plugin-schema * build wasm in prod * feat: plugin loader in transaction * fix: docker build arm64 * generated files * shell check * fix tests * fix: waiting for migration to finish before loading plugin * remove context reassignment * feat: use mise to manage extism tools (#23760) * pr feedback * refactor: create workflow now including create filters and actions * feat: workflow medium tests * fix: broken medium test * feat: medium tests * chore: unify workflow job * sign user id with jwt * chore: query plugin with filters and action * chore: read manifest in repository * chore: load manifest from server configs * merge main * feat: endpoint documentation * pr feedback * load plugin from absolute path * refactor:handle trigger * throw error and return early * pr feedback * unify plugin services * fix: plugins code * clean up * remove triggerConfig * clean up * displayName and methodName --------- Co-authored-by: Jason Rasmussen <jason@rasm.me> Co-authored-by: bo0tzz <git@bo0tzz.me>
108 lines
4.2 KiB
Docker
108 lines
4.2 KiB
Docker
FROM ghcr.io/immich-app/base-server-dev:202511041104@sha256:7558931a4a71989e7fd9fa3e1ba6c28da15891867310edda8c58236171839f2f AS builder
|
|
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
|
|
CI=1 \
|
|
COREPACK_HOME=/tmp \
|
|
PNPM_HOME=/buildcache/pnpm-store \
|
|
PATH="/buildcache/pnpm-store:$PATH"
|
|
|
|
RUN npm install --global corepack@latest && \
|
|
corepack enable pnpm && \
|
|
pnpm config set store-dir "$PNPM_HOME"
|
|
|
|
FROM builder AS server
|
|
|
|
WORKDIR /usr/src/app
|
|
COPY ./server ./server/
|
|
RUN --mount=type=cache,id=pnpm-server,target=/buildcache/pnpm-store \
|
|
--mount=type=bind,source=package.json,target=package.json \
|
|
--mount=type=bind,source=.pnpmfile.cjs,target=.pnpmfile.cjs \
|
|
--mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \
|
|
--mount=type=bind,source=pnpm-workspace.yaml,target=pnpm-workspace.yaml \
|
|
SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm --filter immich --frozen-lockfile build && \
|
|
SHARP_FORCE_GLOBAL_LIBVIPS=true pnpm --filter immich --frozen-lockfile --prod --no-optional deploy /output/server-pruned
|
|
|
|
FROM builder AS web
|
|
|
|
WORKDIR /usr/src/app
|
|
COPY ./web ./web/
|
|
COPY ./i18n ./i18n/
|
|
COPY ./open-api ./open-api/
|
|
RUN --mount=type=cache,id=pnpm-web,target=/buildcache/pnpm-store \
|
|
--mount=type=bind,source=package.json,target=package.json \
|
|
--mount=type=bind,source=.pnpmfile.cjs,target=.pnpmfile.cjs \
|
|
--mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \
|
|
--mount=type=bind,source=pnpm-workspace.yaml,target=pnpm-workspace.yaml \
|
|
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 builder AS cli
|
|
|
|
COPY ./cli ./cli/
|
|
COPY ./open-api ./open-api/
|
|
RUN --mount=type=cache,id=pnpm-cli,target=/buildcache/pnpm-store \
|
|
--mount=type=bind,source=package.json,target=package.json \
|
|
--mount=type=bind,source=.pnpmfile.cjs,target=.pnpmfile.cjs \
|
|
--mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \
|
|
--mount=type=bind,source=pnpm-workspace.yaml,target=pnpm-workspace.yaml \
|
|
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
|
|
|
|
FROM builder AS plugins
|
|
|
|
COPY --from=ghcr.io/jdx/mise:2025.11.3 /usr/local/bin/mise /usr/local/bin/mise
|
|
|
|
WORKDIR /usr/src/app
|
|
COPY ./plugins/mise.toml ./plugins/
|
|
ENV MISE_TRUSTED_CONFIG_PATHS=/usr/src/app/plugins/mise.toml
|
|
RUN mise install --cd plugins
|
|
|
|
COPY ./plugins ./plugins/
|
|
# Build plugins
|
|
RUN --mount=type=cache,id=pnpm-plugins,target=/buildcache/pnpm-store \
|
|
--mount=type=bind,source=package.json,target=package.json \
|
|
--mount=type=bind,source=.pnpmfile.cjs,target=.pnpmfile.cjs \
|
|
--mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \
|
|
--mount=type=bind,source=pnpm-workspace.yaml,target=pnpm-workspace.yaml \
|
|
cd plugins && mise run build
|
|
|
|
FROM ghcr.io/immich-app/base-server-prod:202511041104@sha256:57c0379977fd5521d83cdf661aecd1497c83a9a661ebafe0a5243a09fc1064cb
|
|
|
|
WORKDIR /usr/src/app
|
|
ENV NODE_ENV=production \
|
|
NVIDIA_DRIVER_CAPABILITIES=all \
|
|
NVIDIA_VISIBLE_DEVICES=all
|
|
|
|
COPY --from=server /output/server-pruned ./server
|
|
COPY --from=web /usr/src/app/web/build /build/www
|
|
COPY --from=cli /output/cli-pruned ./cli
|
|
COPY --from=plugins /usr/src/app/plugins/dist /build/corePlugin/dist
|
|
COPY --from=plugins /usr/src/app/plugins/manifest.json /build/corePlugin/manifest.json
|
|
RUN ln -s ../../cli/bin/immich server/bin/immich
|
|
COPY LICENSE /licenses/LICENSE.txt
|
|
COPY LICENSE /LICENSE
|
|
|
|
ENV PATH="${PATH}:/usr/src/app/server/bin"
|
|
|
|
ARG BUILD_ID
|
|
ARG BUILD_IMAGE
|
|
ARG BUILD_SOURCE_REF
|
|
ARG BUILD_SOURCE_COMMIT
|
|
|
|
ENV IMMICH_BUILD=${BUILD_ID}
|
|
ENV IMMICH_BUILD_URL=https://github.com/immich-app/immich/actions/runs/${BUILD_ID}
|
|
ENV IMMICH_BUILD_IMAGE=${BUILD_IMAGE}
|
|
ENV IMMICH_BUILD_IMAGE_URL=https://github.com/immich-app/immich/pkgs/container/immich-server
|
|
ENV IMMICH_REPOSITORY=immich-app/immich
|
|
ENV IMMICH_REPOSITORY_URL=https://github.com/immich-app/immich
|
|
ENV IMMICH_SOURCE_REF=${BUILD_SOURCE_REF}
|
|
ENV IMMICH_SOURCE_COMMIT=${BUILD_SOURCE_COMMIT}
|
|
ENV IMMICH_SOURCE_URL=https://github.com/immich-app/immich/commit/${BUILD_SOURCE_COMMIT}
|
|
|
|
VOLUME /data
|
|
EXPOSE 2283
|
|
ENTRYPOINT ["tini", "--", "/bin/bash", "-c"]
|
|
CMD ["start.sh"]
|
|
|
|
HEALTHCHECK CMD immich-healthcheck
|