2022-10-28 00:21:28 +02:00
|
|
|
|
2022-08-21 06:19:02 +02:00
|
|
|
# Build stage
|
|
|
|
FROM node:16-bullseye-slim as builder
|
2022-03-27 21:58:54 +02:00
|
|
|
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
|
|
COPY package.json package-lock.json ./
|
|
|
|
|
2022-10-28 00:21:28 +02:00
|
|
|
RUN apt-get update
|
|
|
|
RUN apt-get install gcc g++ make cmake python3 python3-pip ffmpeg -y
|
2022-03-27 21:58:54 +02:00
|
|
|
|
2022-07-04 20:47:25 +02:00
|
|
|
RUN npm ci
|
2022-07-23 21:15:55 +02:00
|
|
|
RUN npm rebuild @tensorflow/tfjs-node --build-from-source
|
2022-03-27 21:58:54 +02:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN npm run build
|
2022-08-21 06:19:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Prod stage
|
|
|
|
FROM node:16-bullseye-slim
|
|
|
|
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
|
|
COPY package.json package-lock.json ./
|
2022-08-21 08:04:10 +02:00
|
|
|
COPY entrypoint.sh ./
|
2022-08-21 06:19:02 +02:00
|
|
|
|
|
|
|
RUN mkdir -p /usr/src/app/dist \
|
2022-08-21 07:26:47 +02:00
|
|
|
&& mkdir -p /usr/src/app/node_modules \
|
2022-10-28 00:21:28 +02:00
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get install -y ffmpeg \
|
|
|
|
&& rm -rf /var/cache/apt/lists
|
2022-08-21 06:19:02 +02:00
|
|
|
|
|
|
|
COPY --from=builder /usr/src/app/node_modules ./node_modules
|
|
|
|
COPY --from=builder /usr/src/app/dist ./dist
|
|
|
|
|
|
|
|
RUN npm prune --production
|
|
|
|
|
2022-10-28 00:21:28 +02:00
|
|
|
# CMD [ "node", "dist/main" ]
|