2022-08-21 06:19:02 +02:00
|
|
|
FROM node:16-bullseye-slim as builder
|
2022-03-27 21:58:54 +02:00
|
|
|
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
2022-10-28 00:21:28 +02:00
|
|
|
RUN apt-get update
|
2023-02-03 05:28:34 +02:00
|
|
|
RUN apt-get install gcc g++ make cmake python3 python3-pip -y
|
2022-03-27 21:58:54 +02:00
|
|
|
|
2022-11-10 03:53:21 +02:00
|
|
|
COPY package.json package-lock.json ./
|
|
|
|
|
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 . .
|
|
|
|
|
2022-11-11 06:22:17 +02:00
|
|
|
FROM builder as prod
|
|
|
|
|
2022-03-27 21:58:54 +02:00
|
|
|
RUN npm run build
|
2022-11-11 06:22:17 +02:00
|
|
|
RUN npm prune --omit=dev
|
|
|
|
|
2022-08-21 06:19:02 +02:00
|
|
|
FROM node:16-bullseye-slim
|
|
|
|
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
2022-11-11 06:22:17 +02:00
|
|
|
COPY --from=prod /usr/src/app/node_modules ./node_modules
|
|
|
|
COPY --from=prod /usr/src/app/dist ./dist
|
2022-08-21 06:19:02 +02:00
|
|
|
|
2022-11-10 03:53:21 +02:00
|
|
|
COPY package.json package-lock.json ./
|
|
|
|
COPY entrypoint.sh ./
|
2022-08-21 06:19:02 +02:00
|
|
|
|
2022-11-10 03:53:21 +02:00
|
|
|
# CMD [ "node", "dist/main" ]
|