2022-02-07 14:06:30 -07:00
|
|
|
##################################
|
|
|
|
# DEVELOPMENT
|
|
|
|
##################################
|
2022-02-09 19:48:06 -07:00
|
|
|
FROM node:16-alpine3.14 AS development
|
2022-02-03 13:42:27 -07:00
|
|
|
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
2022-02-07 14:06:30 -07:00
|
|
|
COPY package.json package-lock.json ./
|
2022-02-03 13:42:27 -07:00
|
|
|
|
2022-02-09 19:48:06 -07:00
|
|
|
RUN apk add --update-cache build-base python3 libheif vips-dev vips ffmpeg
|
2022-02-03 13:42:27 -07:00
|
|
|
|
2022-02-07 14:06:30 -07:00
|
|
|
RUN npm install
|
2022-02-03 13:42:27 -07:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2022-02-07 14:06:30 -07:00
|
|
|
RUN npm run build
|
2022-02-03 13:42:27 -07:00
|
|
|
|
2022-02-07 14:06:30 -07:00
|
|
|
##################################
|
|
|
|
# PRODUCTION
|
|
|
|
##################################
|
|
|
|
# FROM node:16-bullseye-slim as production
|
|
|
|
# ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
# ARG NODE_ENV=production
|
|
|
|
# ENV NODE_ENV=${NODE_ENV}
|
2022-02-03 13:42:27 -07:00
|
|
|
|
2022-02-07 14:06:30 -07:00
|
|
|
# WORKDIR /usr/src/app
|
2022-02-03 13:42:27 -07:00
|
|
|
|
2022-02-07 14:06:30 -07:00
|
|
|
# COPY package.json yarn.lock ./
|
2022-02-03 13:42:27 -07:00
|
|
|
|
2022-02-07 14:06:30 -07:00
|
|
|
# RUN apt-get update
|
|
|
|
# RUN apt-get install gcc g++ make cmake python3 python3-pip ffmpeg -y
|
2022-02-03 13:42:27 -07:00
|
|
|
|
2022-02-07 14:06:30 -07:00
|
|
|
# RUN npm i -g yarn --force
|
2022-02-03 13:42:27 -07:00
|
|
|
|
2022-02-07 14:06:30 -07:00
|
|
|
# RUN yarn install --only=production
|
2022-02-03 13:42:27 -07:00
|
|
|
|
2022-02-07 14:06:30 -07:00
|
|
|
# COPY . .
|
2022-02-03 13:42:27 -07:00
|
|
|
|
2022-02-07 14:06:30 -07:00
|
|
|
# COPY --from=development /usr/src/app/dist ./dist
|
|
|
|
|
|
|
|
# # Clean up commands
|
|
|
|
# RUN apt-get autoremove -y && apt-get clean && \
|
|
|
|
# rm -rf /usr/local/src/*
|
|
|
|
|
|
|
|
# RUN apt-get clean && \
|
|
|
|
# rm -rf /var/lib/apt/lists/*
|
2022-02-03 14:27:31 -07:00
|
|
|
|
|
|
|
|
2022-02-07 14:06:30 -07:00
|
|
|
# CMD ["node", "dist/main"]
|