From f602295bf9b2fa0078146b4b9607d423c3610884 Mon Sep 17 00:00:00 2001 From: Mert <101130780+mertalev@users.noreply.github.com> Date: Thu, 21 Dec 2023 10:28:23 -0500 Subject: [PATCH] chore(dev): move envs to image (#5906) --- docker/docker-compose.dev.yml | 4 ---- docker/hwaccel.yml | 1 - server/Dockerfile | 9 +++++++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index 43d2c252cc..ef8feb83f6 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -19,8 +19,6 @@ x-server-build: &server-common - /etc/localtime:/etc/localtime:ro env_file: - .env - environment: - - NODE_ENV=development ulimits: nofile: soft: 1048576 @@ -87,8 +85,6 @@ services: - model-cache:/cache env_file: - .env - environment: - - NODE_ENV=development depends_on: - database restart: unless-stopped diff --git a/docker/hwaccel.yml b/docker/hwaccel.yml index ff2e014e4d..e957efb751 100644 --- a/docker/hwaccel.yml +++ b/docker/hwaccel.yml @@ -11,7 +11,6 @@ services: # volumes: # - /usr/lib/wsl:/usr/lib/wsl # If using VAAPI in WSL2 # environment: - # - NVIDIA_DRIVER_CAPABILITIES=all # If using NVIDIA GPU # - LD_LIBRARY_PATH=/usr/lib/wsl/lib # If using VAAPI in WSL2 # - LIBVA_DRIVER_NAME=d3d12 # If using VAAPI in WSL2 # deploy: # Uncomment this section if using NVIDIA GPU diff --git a/server/Dockerfile b/server/Dockerfile index 3c2a0522e3..1bf1eab8da 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -10,7 +10,10 @@ RUN npm ci && \ rm -rf node_modules/@img/sharp-libvips* && \ rm -rf node_modules/@img/sharp-linuxmusl-x64 COPY server . -ENV PATH="${PATH}:/usr/src/app/bin" +ENV PATH="${PATH}:/usr/src/app/bin" \ + NODE_ENV=development \ + NVIDIA_DRIVER_CAPABILITIES=all \ + NVIDIA_VISIBLE_DEVICES=all ENTRYPOINT ["tini", "--", "/bin/sh"] @@ -34,7 +37,9 @@ RUN npm run build FROM ghcr.io/immich-app/base-server-prod:20231214@sha256:b214f86683fde081b09beed2d7bfc28bec55c829751ccf2e02ad7dd18293f5e0 WORKDIR /usr/src/app -ENV NODE_ENV=production +ENV NODE_ENV=production \ + NVIDIA_DRIVER_CAPABILITIES=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/bin ./bin