1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-10 23:22:22 +02:00

build(server): minimal container (#506)

* build(server): update Dockerfile

* build(server): fix dockerfile

* build(machine-learning): multiple build stages

* build(server): update Dockerfile
This commit is contained in:
Thanh Pham
2022-08-21 11:19:02 +07:00
committed by GitHub
parent 9c30d58b10
commit 1e29ff322d
2 changed files with 47 additions and 6 deletions

View File

@@ -1,15 +1,32 @@
FROM node:16-alpine3.14 as core
ARG DEBIAN_FRONTEND=noninteractive
# Build stage
FROM node:16-alpine3.14 as builder
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN apk add --update-cache build-base python3 libheif vips-dev vips ffmpeg
RUN apk add --update-cache build-base python3 libheif vips-dev
RUN npm ci
COPY . .
RUN npm run build
# Prod stage
FROM node:16-alpine3.14
WORKDIR /usr/src/app
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
COPY --from=builder /usr/src/app/node_modules ./node_modules
COPY --from=builder /usr/src/app/dist ./dist
RUN npm prune --production
EXPOSE 3001