2022-02-07 23:06:30 +02:00
|
|
|
##################################
|
|
|
|
# DEVELOPMENT
|
|
|
|
##################################
|
2022-02-10 04:48:06 +02:00
|
|
|
FROM node:16-alpine3.14 AS development
|
2022-02-03 22:42:27 +02:00
|
|
|
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
2022-02-07 23:06:30 +02:00
|
|
|
COPY package.json package-lock.json ./
|
2022-02-03 22:42:27 +02:00
|
|
|
|
2022-03-22 09:13:16 +02:00
|
|
|
RUN apk add --update-cache build-base python3
|
2022-02-03 22:42:27 +02:00
|
|
|
|
2022-02-07 23:06:30 +02:00
|
|
|
RUN npm install
|
2022-02-03 22:42:27 +02:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2022-02-07 23:06:30 +02:00
|
|
|
RUN npm run build
|
2022-02-03 22:42:27 +02:00
|
|
|
|
2022-02-11 04:40:11 +02:00
|
|
|
#################################
|
2022-02-07 23:06:30 +02:00
|
|
|
# PRODUCTION
|
2022-02-11 04:40:11 +02:00
|
|
|
#################################
|
|
|
|
FROM node:16-alpine3.14 AS production
|
2022-02-03 22:42:27 +02:00
|
|
|
|
2022-02-11 04:40:11 +02:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
ARG NODE_ENV=production
|
|
|
|
ENV NODE_ENV=${NODE_ENV}
|
2022-02-03 22:42:27 +02:00
|
|
|
|
2022-02-11 04:40:11 +02:00
|
|
|
WORKDIR /usr/src/app
|
2022-02-03 22:42:27 +02:00
|
|
|
|
2022-02-11 04:40:11 +02:00
|
|
|
COPY package.json package-lock.json ./
|
2022-02-03 22:42:27 +02:00
|
|
|
|
2022-03-22 09:13:16 +02:00
|
|
|
RUN apk add --update-cache build-base python3
|
2022-02-07 23:06:30 +02:00
|
|
|
|
2022-02-11 04:40:11 +02:00
|
|
|
RUN npm install --only=production
|
2022-02-07 23:06:30 +02:00
|
|
|
|
2022-02-11 04:40:11 +02:00
|
|
|
COPY . .
|
2022-02-03 23:27:31 +02:00
|
|
|
|
2022-02-11 04:40:11 +02:00
|
|
|
COPY --from=development /usr/src/app/dist ./dist
|
2022-02-03 23:27:31 +02:00
|
|
|
|
2022-02-11 04:40:11 +02:00
|
|
|
CMD ["node", "dist/main"]
|