diff --git a/server/Dockerfile b/server/Dockerfile index bd269a378..5d4176080 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -37,6 +37,7 @@ COPY server/start*.sh ./ RUN npm link && npm cache clean --force COPY LICENSE /licenses/LICENSE.txt COPY LICENSE /LICENSE +ENV PATH="${PATH}:/usr/src/app/bin" VOLUME /usr/src/app/upload EXPOSE 3001 ENTRYPOINT ["tini", "--", "/bin/sh"] diff --git a/server/bin/admin-cli.sh b/server/bin/admin-cli.sh deleted file mode 100755 index b63e331eb..000000000 --- a/server/bin/admin-cli.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env sh -./start.sh admin-cli $1 diff --git a/server/bin/cli.sh b/server/bin/cli.sh deleted file mode 100755 index 3c6b1512e..000000000 --- a/server/bin/cli.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -npx immich "$@" diff --git a/server/bin/immich b/server/bin/immich new file mode 100755 index 000000000..053e87313 --- /dev/null +++ b/server/bin/immich @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +node /usr/src/app/node_modules/.bin/immich "$@" diff --git a/server/bin/immich-admin b/server/bin/immich-admin new file mode 100755 index 000000000..0634eae4b --- /dev/null +++ b/server/bin/immich-admin @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +/usr/src/app/start.sh immich-admin $1 diff --git a/server/package-lock.json b/server/package-lock.json index 77145427a..60367eb33 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -53,10 +53,6 @@ "typesense": "^1.7.1", "ua-parser-js": "^1.0.35" }, - "bin": { - "immich": "bin/cli.sh", - "immich-admin": "bin/admin-cli.sh" - }, "devDependencies": { "@nestjs/cli": "^10.1.16", "@nestjs/schematics": "^10.0.2", diff --git a/server/package.json b/server/package.json index bf424abe8..7c637215f 100644 --- a/server/package.json +++ b/server/package.json @@ -5,10 +5,6 @@ "author": "", "private": true, "license": "UNLICENSED", - "bin": { - "immich": "./bin/cli.sh", - "immich-admin": "./bin/admin-cli.sh" - }, "scripts": { "build": "nest build", "format": "prettier --check .", diff --git a/server/src/admin-cli/app.module.ts b/server/src/immich-admin/app.module.ts similarity index 100% rename from server/src/admin-cli/app.module.ts rename to server/src/immich-admin/app.module.ts diff --git a/server/src/admin-cli/commands/list-users.command.ts b/server/src/immich-admin/commands/list-users.command.ts similarity index 100% rename from server/src/admin-cli/commands/list-users.command.ts rename to server/src/immich-admin/commands/list-users.command.ts diff --git a/server/src/admin-cli/commands/password-login.ts b/server/src/immich-admin/commands/password-login.ts similarity index 100% rename from server/src/admin-cli/commands/password-login.ts rename to server/src/immich-admin/commands/password-login.ts diff --git a/server/src/admin-cli/commands/reset-admin-password.command.ts b/server/src/immich-admin/commands/reset-admin-password.command.ts similarity index 100% rename from server/src/admin-cli/commands/reset-admin-password.command.ts rename to server/src/immich-admin/commands/reset-admin-password.command.ts diff --git a/server/src/admin-cli/constants.ts b/server/src/immich-admin/constants.ts similarity index 100% rename from server/src/admin-cli/constants.ts rename to server/src/immich-admin/constants.ts diff --git a/server/src/admin-cli/main.ts b/server/src/immich-admin/main.ts similarity index 100% rename from server/src/admin-cli/main.ts rename to server/src/immich-admin/main.ts diff --git a/server/src/main.ts b/server/src/main.ts index b86f4f789..c43d6ea46 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -1,5 +1,5 @@ -import { bootstrap as adminCli } from './admin-cli/main'; -import { bootstrap as immich } from './immich/main'; +import { bootstrap as admin } from './immich-admin/main'; +import { bootstrap as server } from './immich/main'; import { bootstrap as microservices } from './microservices/main'; const immichApp = process.argv[2] || process.env.IMMICH_APP; @@ -12,13 +12,13 @@ function bootstrap() { switch (immichApp) { case 'immich': process.title = 'immich_server'; - return immich(); + return server(); case 'microservices': process.title = 'immich_microservices'; return microservices(); - case 'admin-cli': + case 'immich-admin': process.title = 'immich_admin_cli'; - return adminCli(); + return admin(); default: console.log(`Invalid app name: ${immichApp}. Expected one of immich|microservices|cli`); process.exit(1); diff --git a/server/start.sh b/server/start.sh index 5ec1a2643..7aa0bc20d 100755 --- a/server/start.sh +++ b/server/start.sh @@ -32,4 +32,4 @@ if [ "$REDIS_PASSWORD_FILE" ]; then unset REDIS_PASSWORD_FILE fi -exec node dist/main $@ +exec node /usr/src/app/dist/main $@