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