mirror of
https://github.com/immich-app/immich.git
synced 2025-07-31 15:08:44 -04:00
chore: dockerfile layout changes (#19673)
Dockerfile layout changes Fix up web path feat: update server env vars for layout
This commit is contained in:
parent
5d244c6fec
commit
9e94f52b05
@ -1,41 +1,41 @@
|
|||||||
.vscode/
|
.vscode/
|
||||||
.github/
|
.github/
|
||||||
.git/
|
.git/
|
||||||
|
.env*
|
||||||
|
*.log
|
||||||
|
*.tmp
|
||||||
|
*.temp
|
||||||
|
|
||||||
|
**/Dockerfile
|
||||||
|
**/node_modules/
|
||||||
|
**/.pnpm-store/
|
||||||
|
**/dist/
|
||||||
|
**/coverage/
|
||||||
|
**/build/
|
||||||
|
|
||||||
design/
|
design/
|
||||||
docker/
|
docker/
|
||||||
Dockerfile
|
|
||||||
!docker/scripts
|
!docker/scripts
|
||||||
|
|
||||||
docs/
|
docs/
|
||||||
!docs/package.json
|
!docs/package.json
|
||||||
!docs/package-lock.json
|
!docs/package-lock.json
|
||||||
|
|
||||||
e2e/
|
e2e/
|
||||||
!e2e/package.json
|
!e2e/package.json
|
||||||
!e2e/package-lock.json
|
!e2e/package-lock.json
|
||||||
|
|
||||||
fastlane/
|
fastlane/
|
||||||
machine-learning/
|
machine-learning/
|
||||||
misc/
|
misc/
|
||||||
mobile/
|
mobile/
|
||||||
|
|
||||||
cli/coverage/
|
|
||||||
cli/dist/
|
|
||||||
cli/node_modules/
|
|
||||||
cli/Dockerfile
|
|
||||||
|
|
||||||
open-api/typescript-sdk/build/
|
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/upload/
|
||||||
server/src/queries
|
server/src/queries
|
||||||
server/dist/
|
|
||||||
server/www/
|
server/www/
|
||||||
server/Dockerfile
|
|
||||||
|
|
||||||
web/node_modules/
|
|
||||||
web/coverage/
|
|
||||||
web/.svelte-kit
|
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
|
mobile/ios/fastlane/report.xml
|
||||||
|
|
||||||
vite.config.js.timestamp-*
|
vite.config.js.timestamp-*
|
||||||
|
.pnpm-store
|
||||||
|
@ -27,11 +27,11 @@ services:
|
|||||||
target: dev
|
target: dev
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ../server:/usr/src/app
|
- ../server:/usr/src/app/server
|
||||||
- ../open-api:/usr/src/open-api
|
- ../open-api:/usr/src/app/open-api
|
||||||
- ${UPLOAD_LOCATION}/photos:/usr/src/app/upload
|
- ${UPLOAD_LOCATION}/photos:/usr/src/app/upload
|
||||||
- ${UPLOAD_LOCATION}/photos/upload:/usr/src/app/upload/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
|
- /etc/localtime:/etc/localtime:ro
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
@ -69,7 +69,8 @@ services:
|
|||||||
# Needed for rootless docker setup, see https://github.com/moby/moby/issues/45919
|
# Needed for rootless docker setup, see https://github.com/moby/moby/issues/45919
|
||||||
# user: 0:0
|
# user: 0:0
|
||||||
build:
|
build:
|
||||||
context: ../web
|
context: ../
|
||||||
|
dockerfile: web/Dockerfile
|
||||||
command: ['immich-web']
|
command: ['immich-web']
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
@ -77,11 +78,11 @@ services:
|
|||||||
- 3000:3000
|
- 3000:3000
|
||||||
- 24678:24678
|
- 24678:24678
|
||||||
volumes:
|
volumes:
|
||||||
- ../web:/usr/src/app
|
- ../web:/usr/src/app/web
|
||||||
- ../i18n:/usr/src/i18n
|
- ../i18n:/usr/src/app/i18n
|
||||||
- ../open-api/:/usr/src/open-api/
|
- ../open-api/:/usr/src/app/open-api/
|
||||||
# - ../../ui:/usr/ui
|
# - ../../ui:/usr/ui
|
||||||
- /usr/src/app/node_modules
|
- /usr/src/app/web/node_modules
|
||||||
ulimits:
|
ulimits:
|
||||||
nofile:
|
nofile:
|
||||||
soft: 1048576
|
soft: 1048576
|
||||||
|
@ -2,25 +2,26 @@
|
|||||||
FROM ghcr.io/immich-app/base-server-dev:202507162011@sha256:85d4230c2208646bd6c528db41b2213d780b11b7a311397ca6a2aaba7cf697c8 AS dev
|
FROM ghcr.io/immich-app/base-server-dev:202507162011@sha256:85d4230c2208646bd6c528db41b2213d780b11b7a311397ca6a2aaba7cf697c8 AS dev
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
COPY server/package.json server/package-lock.json ./
|
COPY ./server/package* ./server/
|
||||||
|
WORKDIR /usr/src/app/server
|
||||||
RUN npm ci && \
|
RUN npm ci && \
|
||||||
# exiftool-vendored.pl, sharp-linux-x64 and sharp-linux-arm64 are the only ones we need
|
# 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
|
# 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-libvips* && \
|
||||||
rm -rf node_modules/@img/sharp-linuxmusl-x64
|
rm -rf node_modules/@img/sharp-linuxmusl-x64
|
||||||
ENV PATH="${PATH}:/usr/src/app/bin" \
|
ENV PATH="${PATH}:/usr/src/app/server/bin" \
|
||||||
IMMICH_ENV=development \
|
IMMICH_ENV=development \
|
||||||
NVIDIA_DRIVER_CAPABILITIES=all \
|
NVIDIA_DRIVER_CAPABILITIES=all \
|
||||||
NVIDIA_VISIBLE_DEVICES=all
|
NVIDIA_VISIBLE_DEVICES=all
|
||||||
ENTRYPOINT ["tini", "--", "/bin/sh", "-c"]
|
ENTRYPOINT ["tini", "--", "/bin/bash", "-c"]
|
||||||
|
|
||||||
FROM dev AS dev-container-server
|
FROM dev AS dev-container-server
|
||||||
|
|
||||||
RUN rm -rf /usr/src/app
|
RUN rm -rf /usr/src/app
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install sudo inetutils-ping openjdk-11-jre-headless \
|
apt-get install sudo inetutils-ping openjdk-11-jre-headless \
|
||||||
vim nano \
|
vim nano \
|
||||||
-y --no-install-recommends --fix-missing
|
-y --no-install-recommends --fix-missing
|
||||||
|
|
||||||
RUN usermod -aG sudo node
|
RUN usermod -aG sudo node
|
||||||
RUN echo "node ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
RUN echo "node ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||||
@ -38,14 +39,14 @@ FROM dev-container-server AS dev-container-mobile
|
|||||||
USER root
|
USER root
|
||||||
# Enable multiarch for arm64 if necessary
|
# Enable multiarch for arm64 if necessary
|
||||||
RUN if [ "$(dpkg --print-architecture)" = "arm64" ]; then \
|
RUN if [ "$(dpkg --print-architecture)" = "arm64" ]; then \
|
||||||
dpkg --add-architecture amd64 && \
|
dpkg --add-architecture amd64 && \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
qemu-user-static \
|
qemu-user-static \
|
||||||
libc6:amd64 \
|
libc6:amd64 \
|
||||||
libstdc++6:amd64 \
|
libstdc++6:amd64 \
|
||||||
libgcc1:amd64; \
|
libgcc1:amd64; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Flutter SDK
|
# Flutter SDK
|
||||||
# https://flutter.dev/docs/development/tools/sdk/releases?tab=linux
|
# https://flutter.dev/docs/development/tools/sdk/releases?tab=linux
|
||||||
@ -77,43 +78,42 @@ FROM dev AS prod
|
|||||||
COPY server .
|
COPY server .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
RUN npm prune --omit=dev --omit=optional
|
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/server/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/exiftool-vendored.pl ./node_modules/exiftool-vendored.pl
|
||||||
|
|
||||||
# web build
|
# web build
|
||||||
FROM node:22.16.0-alpine3.20@sha256:2289fb1fba0f4633b08ec47b94a89c7e20b829fc5679f9b7b298eaa2f1ed8b7e AS web
|
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
|
WORKDIR /usr/src/app
|
||||||
COPY web/package*.json web/svelte.config.js ./
|
COPY ./web ./web/
|
||||||
RUN npm ci
|
COPY ./i18n ./i18n/
|
||||||
COPY web ./
|
COPY ./open-api/typescript-sdk ./open-api/typescript-sdk/
|
||||||
COPY i18n ../i18n
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
|
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
|
# prod build
|
||||||
FROM ghcr.io/immich-app/base-server-prod:202507162011@sha256:636f3ddb6106628ef851d51c23f3fa2c6e4829390cc315b27b38c288c82b23a7
|
FROM ghcr.io/immich-app/base-server-prod:202507162011@sha256:636f3ddb6106628ef851d51c23f3fa2c6e4829390cc315b27b38c288c82b23a7
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
ENV NODE_ENV=production \
|
ENV NODE_ENV=production \
|
||||||
NVIDIA_DRIVER_CAPABILITIES=all \
|
NVIDIA_DRIVER_CAPABILITIES=all \
|
||||||
NVIDIA_VISIBLE_DEVICES=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/server/node_modules ./server/node_modules
|
||||||
COPY --from=prod /usr/src/app/bin ./bin
|
COPY --from=prod /usr/src/app/server/dist ./server/dist
|
||||||
COPY --from=web /usr/src/app/build /build/www
|
COPY --from=prod /usr/src/app/server/bin ./server/bin
|
||||||
COPY server/resources resources
|
COPY --from=web /usr/src/app/web/build /build/www
|
||||||
COPY server/package.json server/package-lock.json ./
|
COPY ./server/resources ./server/resources
|
||||||
RUN npm install -g @immich/cli && npm cache clean --force
|
COPY ./server/package.json server/package-lock.json ./
|
||||||
COPY LICENSE /licenses/LICENSE.txt
|
COPY LICENSE /licenses/LICENSE.txt
|
||||||
COPY LICENSE /LICENSE
|
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_ID
|
||||||
ARG BUILD_IMAGE
|
ARG BUILD_IMAGE
|
||||||
|
@ -5,5 +5,5 @@ if [ "$IMMICH_ENV" != "development" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /usr/src/app || exit 1
|
cd /usr/src/app/server || exit 1
|
||||||
node ./node_modules/.bin/nest start --debug "0.0.0.0:9230" --watch -- "$@"
|
npm exec nest start --debug "0.0.0.0:9230" --watch -- "$@"
|
||||||
|
@ -8,7 +8,7 @@ else
|
|||||||
echo "skipping libmimalloc - path not found $lib_path"
|
echo "skipping libmimalloc - path not found $lib_path"
|
||||||
fi
|
fi
|
||||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/jellyfin-ffmpeg/lib"
|
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() {
|
read_file_and_export() {
|
||||||
if [ -n "${!1}" ]; then
|
if [ -n "${!1}" ]; then
|
||||||
|
@ -1,12 +1,17 @@
|
|||||||
FROM node:22.16.0-alpine3.20@sha256:2289fb1fba0f4633b08ec47b94a89c7e20b829fc5679f9b7b298eaa2f1ed8b7e
|
FROM node:22.16.0-alpine3.20@sha256:2289fb1fba0f4633b08ec47b94a89c7e20b829fc5679f9b7b298eaa2f1ed8b7e
|
||||||
|
|
||||||
RUN apk add --no-cache tini
|
RUN apk add --no-cache tini bash
|
||||||
|
|
||||||
USER node
|
USER node
|
||||||
WORKDIR /usr/src/app
|
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
|
RUN npm ci
|
||||||
|
|
||||||
ENV CHOKIDAR_USEPOLLING=true \
|
ENV CHOKIDAR_USEPOLLING=true \
|
||||||
PATH="${PATH}:/usr/src/app/bin"
|
PATH="${PATH}:/usr/src/app/web/bin"
|
||||||
EXPOSE 24678
|
EXPOSE 24678
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
ENTRYPOINT ["/sbin/tini", "--", "/bin/sh", "-c"]
|
ENTRYPOINT ["tini", "--", "/bin/bash", "-c"]
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/usr/bin/env sh
|
#!/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" install
|
||||||
npm --prefix "$TYPESCRIPT_SDK" run build
|
npm --prefix "$TYPESCRIPT_SDK" run build
|
||||||
|
|
||||||
cd /usr/src/app || exit 1
|
cd /usr/src/app/web || exit 1
|
||||||
|
|
||||||
COUNT=0
|
COUNT=0
|
||||||
UPSTREAM="${IMMICH_SERVER_URL:-http://immich-server:2283/}"
|
UPSTREAM="${IMMICH_SERVER_URL:-http://immich-server:2283/}"
|
||||||
@ -19,4 +19,4 @@ done
|
|||||||
|
|
||||||
echo "Connected to $UPSTREAM"
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user