correct docker build

This commit is contained in:
Jonathan Jogenfors 2023-11-19 00:28:14 +01:00
parent 2981a383d2
commit 3ca69601a8
2 changed files with 8 additions and 16 deletions

View file

@ -1,9 +1,14 @@
FROM ghcr.io/immich-app/base-server-dev:20231109 as builder FROM ghcr.io/immich-app/base-server-dev:20231109 as builder
COPY cli/package.json cli/package-lock.json ./ WORKDIR /usr/src/app/server
COPY server/package.json server/package-lock.json ./
RUN npm ci RUN npm ci
COPY cli . COPY ./server/ .
WORKDIR /usr/src/app/cli
COPY cli/package.json cli/package-lock.json cli/test/ ./
RUN npm ci
COPY ./cli/ .
FROM builder as prod FROM builder as prod
@ -13,19 +18,7 @@ RUN npm prune --omit=dev --omit=optional
FROM ghcr.io/immich-app/base-server-prod:20231109 FROM ghcr.io/immich-app/base-server-prod:20231109
ENV NODE_ENV=production
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
COPY server/assets ./assets
COPY LICENSE /licenses/LICENSE.txt
COPY LICENSE /LICENSE
COPY server/package.json server/package-lock.json ./
COPY server/start*.sh ./
RUN npm link && npm cache clean --force
VOLUME /usr/src/app/upload VOLUME /usr/src/app/upload
EXPOSE 3001 EXPOSE 3001

View file

@ -9,10 +9,9 @@ services:
context: ../ context: ../
dockerfile: cli/Dockerfile dockerfile: cli/Dockerfile
target: builder target: builder
working_dir: /usr/src/app/cli
command: npm run test:e2e command: npm run test:e2e
volumes: volumes:
- ../cli:/usr/src/app
- ../server:/usr/src/server
- /usr/src/app/node_modules - /usr/src/app/node_modules
environment: environment:
- DB_HOSTNAME=database - DB_HOSTNAME=database