diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index 60685d84d6..bc187455a9 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -55,6 +55,7 @@ services: image: immich-web-dev:latest build: context: ../web + target: dev command: ['/usr/src/app/bin/immich-web'] env_file: - .env diff --git a/server/Dockerfile b/server/Dockerfile index 64dcab758b..ba30047f22 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -9,7 +9,6 @@ RUN npm ci && \ # 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-linuxmusl-x64 -COPY server . ENV PATH="${PATH}:/usr/src/app/bin" \ IMMICH_ENV=development \ NVIDIA_DRIVER_CAPABILITIES=all \ @@ -19,6 +18,7 @@ ENTRYPOINT ["tini", "--", "/bin/sh"] FROM dev AS prod +COPY server . RUN npm run build RUN npm prune --omit=dev --omit=optional COPY --from=dev /usr/src/app/node_modules/@img ./node_modules/@img diff --git a/web/Dockerfile b/web/Dockerfile index 19d8d890ab..fbefbbec1b 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -1,12 +1,14 @@ -FROM node:20.17.0-alpine3.20@sha256:2d07db07a2df6830718ae2a47db6fedce6745f5bcd174c398f2acdda90a11c03 +FROM node:20.17.0-alpine3.20@sha256:2d07db07a2df6830718ae2a47db6fedce6745f5bcd174c398f2acdda90a11c03 AS dev RUN apk add --no-cache tini USER node WORKDIR /usr/src/app COPY --chown=node:node package*.json ./ RUN npm ci -COPY --chown=node:node . . ENV CHOKIDAR_USEPOLLING=true EXPOSE 24678 EXPOSE 3000 ENTRYPOINT ["/sbin/tini", "--", "/bin/sh"] + +FROM dev +COPY --chown=node:node . . \ No newline at end of file