From 6acd8eb4ba0f6cc5c44082be37c711f8cf8111dc Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Fri, 8 Dec 2023 21:58:07 -0500 Subject: [PATCH] chore(server): faster shutdown (#5577) * chore(server): faster shutdown * fix: e2e test entrypoint --- docker/docker-compose.dev.yml | 4 ++-- docker/docker-compose.test.yml | 3 ++- server/Dockerfile | 2 ++ server/bin/immich-dev | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100755 server/bin/immich-dev diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index 9eb4cf97dc..f1208207c2 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -29,7 +29,7 @@ x-server-build: &server-common services: immich-server: container_name: immich_server - command: npm run start:debug immich + command: [ "/usr/src/app/bin/immich-dev", "immich" ] <<: *server-common ports: - 3001:3001 @@ -40,7 +40,7 @@ services: immich-microservices: container_name: immich_microservices - command: npm run start:debug microservices + command: [ "/usr/src/app/bin/immich-dev", "microservices" ] <<: *server-common # extends: # file: hwaccel.yml diff --git a/docker/docker-compose.test.yml b/docker/docker-compose.test.yml index 1f7df431a6..dbedce2c67 100644 --- a/docker/docker-compose.test.yml +++ b/docker/docker-compose.test.yml @@ -9,7 +9,8 @@ services: context: ../ dockerfile: server/Dockerfile target: dev - command: npm run test:e2e + entrypoint: [ "/usr/local/bin/npm", "run" ] + command: test:e2e volumes: - ../server:/usr/src/app - /usr/src/app/node_modules diff --git a/server/Dockerfile b/server/Dockerfile index 6b1bf1e509..cf1cce299c 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,6 +1,7 @@ # dev build FROM ghcr.io/immich-app/base-server-dev:20231207@sha256:175d55f2fff48e0edeaf359c1aa0572b923db0c19304c22136a39061b8bc8179 as dev +RUN apt-get install --no-install-recommends -yqq tini WORKDIR /usr/src/app COPY server/package.json server/package-lock.json ./ RUN npm ci && \ @@ -9,6 +10,7 @@ RUN npm ci && \ rm -rf node_modules/@img/sharp-libvips* && \ rm -rf node_modules/@img/sharp-linuxmusl-x64 COPY server . +ENTRYPOINT ["tini", "--", "/bin/sh"] FROM dev AS prod diff --git a/server/bin/immich-dev b/server/bin/immich-dev new file mode 100755 index 0000000000..fcf064bf79 --- /dev/null +++ b/server/bin/immich-dev @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +node /usr/src/app/node_modules/.bin/nest start --debug "0.0.0.0:9230" --watch -- "$@"