mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
build(server): use github-action cache (#949)
* build(server): prune dependencies in docker builder * fix: e2e tests * refactor: dockerfile step order * fix: vips build dependency * feat: use caching
This commit is contained in:
@@ -2,33 +2,32 @@ FROM node:16-alpine3.14 as builder
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
RUN apk add --update-cache build-base python3 libheif vips-dev ffmpeg
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
RUN apk add --update-cache build-base python3 libheif vips-dev ffmpeg
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN npm run build
|
||||
RUN npm prune --omit=dev
|
||||
|
||||
# Prod stage
|
||||
FROM node:16-alpine3.14
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
COPY LICENSE /licenses/LICENSE.txt
|
||||
COPY LICENSE /LICENSE
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
COPY start-server.sh start-microservices.sh ./
|
||||
|
||||
RUN mkdir -p /usr/src/app/dist \
|
||||
&& apk add --no-cache libheif vips ffmpeg
|
||||
RUN apk add --no-cache libheif vips ffmpeg
|
||||
|
||||
COPY --from=builder /usr/src/app/node_modules ./node_modules
|
||||
COPY --from=builder /usr/src/app/dist ./dist
|
||||
COPY --from=builder /usr/src/app/bin ./bin
|
||||
|
||||
RUN npm prune --production
|
||||
COPY LICENSE /licenses/LICENSE.txt
|
||||
COPY LICENSE /LICENSE
|
||||
COPY package.json package-lock.json ./
|
||||
COPY start-server.sh start-microservices.sh ./
|
||||
|
||||
VOLUME /usr/src/app/upload
|
||||
|
||||
|
||||
Reference in New Issue
Block a user