fix(server): immich command (#5408)

* fix: immich command

* chore: use absolute paths
This commit is contained in:
Jason Rasmussen 2023-11-30 15:59:47 -05:00 committed by GitHub
parent 5e55a17b2a
commit 6e365b37db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 11 additions and 18 deletions

View file

@ -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"]

View file

@ -1,2 +0,0 @@
#!/usr/bin/env sh
./start.sh admin-cli $1

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
npx immich "$@"

2
server/bin/immich Executable file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env bash
node /usr/src/app/node_modules/.bin/immich "$@"

2
server/bin/immich-admin Executable file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env sh
/usr/src/app/start.sh immich-admin $1

View file

@ -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",

View file

@ -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 .",

View file

@ -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);

View file

@ -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 $@