mirror of
https://github.com/immich-app/immich.git
synced 2024-11-16 18:42:17 -07:00
1e29ff322d
* build(server): update Dockerfile * build(server): fix dockerfile * build(machine-learning): multiple build stages * build(server): update Dockerfile
42 lines
814 B
Docker
42 lines
814 B
Docker
# Build stage
|
|
FROM node:16-bullseye-slim as builder
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
COPY package.json package-lock.json ./
|
|
|
|
RUN apt-get update
|
|
RUN apt-get install gcc g++ make cmake python3 python3-pip ffmpeg -y
|
|
|
|
RUN npm ci
|
|
RUN npm rebuild @tensorflow/tfjs-node --build-from-source
|
|
|
|
COPY . .
|
|
|
|
RUN npm run build
|
|
|
|
|
|
# Prod stage
|
|
FROM node:16-bullseye-slim
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
COPY package.json package-lock.json ./
|
|
|
|
RUN mkdir -p /usr/src/app/dist \
|
|
&& mkdir -p /usr/src/app/node_modules \
|
|
&& apt-get update \
|
|
&& apt-get install -y ffmpeg \
|
|
&& rm -rf /var/cache/apt/lists
|
|
|
|
COPY --from=builder /usr/src/app/node_modules ./node_modules
|
|
COPY --from=builder /usr/src/app/dist ./dist
|
|
|
|
RUN npm prune --production
|
|
|
|
CMD [ "node", "dist/main" ]
|