mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04:00
chore: dockerfile layout changes
This commit is contained in:
parent
523cce7f6f
commit
139b9694db
@ -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
|
||||||
|
2
cli/package-lock.json
generated
2
cli/package-lock.json
generated
@ -16,7 +16,7 @@
|
|||||||
"micromatch": "^4.0.8"
|
"micromatch": "^4.0.8"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"immich": "dist/index.js"
|
"immich": "bin/immich"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/eslintrc": "^3.1.0",
|
"@eslint/eslintrc": "^3.1.0",
|
||||||
|
@ -16,7 +16,7 @@ name: immich-dev
|
|||||||
services:
|
services:
|
||||||
immich-server:
|
immich-server:
|
||||||
container_name: immich_server
|
container_name: immich_server
|
||||||
command: ['/usr/src/app/bin/immich-dev']
|
command: ['/usr/src/app/server/bin/immich-dev']
|
||||||
image: immich-server-dev:latest
|
image: immich-server-dev:latest
|
||||||
# extends:
|
# extends:
|
||||||
# file: hwaccel.transcoding.yml
|
# file: hwaccel.transcoding.yml
|
||||||
@ -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/server/upload
|
||||||
- ${UPLOAD_LOCATION}/photos/upload:/usr/src/app/upload/upload
|
- ${UPLOAD_LOCATION}/photos/upload:/usr/src/app/server/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,19 +69,20 @@ 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: ../
|
||||||
command: ['/usr/src/app/bin/immich-web']
|
dockerfile: web/Dockerfile
|
||||||
|
command: ['/usr/src/app/web/bin/immich-web']
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
ports:
|
ports:
|
||||||
- 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
e2e/package-lock.json
generated
2
e2e/package-lock.json
generated
@ -56,7 +56,7 @@
|
|||||||
"micromatch": "^4.0.8"
|
"micromatch": "^4.0.8"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"immich": "dist/index.js"
|
"immich": "bin/immich"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/eslintrc": "^3.1.0",
|
"@eslint/eslintrc": "^3.1.0",
|
||||||
|
@ -4,25 +4,26 @@ FROM ghcr.io/immich-app/base-server-dev:commit-a050847fdf07f1e492919810121419f65
|
|||||||
# This next line is temporary, until the docker images are tagged properly. Currently, the dev tag is the same as the prod tag.
|
# This next line is temporary, until the docker images are tagged properly. Currently, the dev tag is the same as the prod tag.
|
||||||
RUN apt-get update && apt-get install --no-install-recommends -yqq tini make
|
RUN apt-get update && apt-get install --no-install-recommends -yqq tini make
|
||||||
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/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"]
|
ENTRYPOINT ["tini", "--", "/bin/sh"]
|
||||||
|
|
||||||
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
|
||||||
@ -40,14 +41,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
|
||||||
@ -79,40 +80,37 @@ 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:commit-a050847fdf07f1e492919810121419f65ec9eb45
|
FROM ghcr.io/immich-app/base-server-prod:commit-a050847fdf07f1e492919810121419f65ec9eb45
|
||||||
|
|
||||||
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/server/node_modules ./node_modules
|
||||||
COPY --from=prod /usr/src/app/dist ./dist
|
COPY --from=prod /usr/src/app/server/dist ./dist
|
||||||
COPY --from=prod /usr/src/app/bin ./bin
|
COPY --from=prod /usr/src/app/server/bin ./bin
|
||||||
COPY --from=web /usr/src/app/build /build/www
|
COPY --from=web /usr/src/app/web/build /build/www
|
||||||
COPY server/resources resources
|
COPY ./server/resources resources
|
||||||
COPY server/package.json server/package-lock.json ./
|
COPY ./server/package.json server/package-lock.json ./
|
||||||
COPY server/start*.sh ./
|
COPY ./server/start*.sh ./
|
||||||
COPY "docker/scripts/get-cpus.sh" ./
|
COPY "docker/scripts/get-cpus.sh" ./
|
||||||
RUN npm install -g @immich/cli && npm cache clean --force
|
RUN npm install -g @immich/cli && npm cache clean --force
|
||||||
COPY LICENSE /licenses/LICENSE.txt
|
COPY LICENSE /licenses/LICENSE.txt
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
node /usr/src/app/node_modules/.bin/nest start --debug "0.0.0.0:9230" --watch -- "$@"
|
cd /usr/src/app/server || exit 1
|
||||||
|
npm install
|
||||||
|
node ./node_modules/.bin/nest start --debug "0.0.0.0:9230" --watch -- "$@"
|
||||||
|
@ -1,10 +1,16 @@
|
|||||||
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 make
|
||||||
|
|
||||||
USER node
|
USER node
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
COPY --chown=node:node package*.json ./
|
COPY --chown=node:node ./web ./web/
|
||||||
|
COPY --chown=node:node ./open-api ./open-api/
|
||||||
|
COPY --chown=node:node Makefile ./
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app/web
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|
||||||
ENV CHOKIDAR_USEPOLLING=true
|
ENV CHOKIDAR_USEPOLLING=true
|
||||||
EXPOSE 24678
|
EXPOSE 24678
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
#!/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
|
||||||
|
|
||||||
|
cd /usr/src/app/web || exit 1
|
||||||
npm --prefix "$TYPESCRIPT_SDK" install
|
npm --prefix "$TYPESCRIPT_SDK" install
|
||||||
npm --prefix "$TYPESCRIPT_SDK" run build
|
npm --prefix "$TYPESCRIPT_SDK" run build
|
||||||
|
|
||||||
|
npm install
|
||||||
|
|
||||||
COUNT=0
|
COUNT=0
|
||||||
UPSTREAM="${IMMICH_SERVER_URL:-http://immich-server:2283/}"
|
UPSTREAM="${IMMICH_SERVER_URL:-http://immich-server:2283/}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user