2021-07-27 12:34:56 +00:00
|
|
|
ARG NODE_VERSION=14
|
|
|
|
|
|
|
|
#######################
|
|
|
|
## With this step we prepare all node_modules, this helps caching the build
|
|
|
|
## Speed up this step by mounting your local node_modules directory
|
|
|
|
#######################
|
|
|
|
FROM node:${NODE_VERSION} as npm-base
|
|
|
|
WORKDIR /console
|
|
|
|
|
|
|
|
COPY console/package.json console/package-lock.json ./
|
2022-02-14 14:35:16 +00:00
|
|
|
RUN npm ci
|
2021-07-27 12:34:56 +00:00
|
|
|
|
|
|
|
COPY console .
|
2022-02-14 14:35:16 +00:00
|
|
|
COPY --from=zitadel-base:local /proto /proto
|
|
|
|
COPY --from=zitadel-base:local /usr/local/bin /usr/local/bin/.
|
2021-07-27 12:34:56 +00:00
|
|
|
COPY build/console build/console/
|
|
|
|
RUN build/console/generate-grpc.sh
|
|
|
|
|
|
|
|
#######################
|
|
|
|
## copy for local dev
|
|
|
|
#######################
|
|
|
|
FROM scratch as npm-copy
|
2022-02-14 14:35:16 +00:00
|
|
|
COPY --from=npm-base /console/src/app/proto/generated .
|
2021-07-27 12:34:56 +00:00
|
|
|
|
|
|
|
#######################
|
|
|
|
## angular lint workspace and prod build
|
|
|
|
#######################
|
2022-02-14 14:35:16 +00:00
|
|
|
FROM npm-base as angular-build
|
2021-07-27 12:34:56 +00:00
|
|
|
RUN npm run lint
|
|
|
|
RUN npm run prodbuild
|
2022-02-14 14:35:16 +00:00
|
|
|
RUN ls -la /console/dist/console
|
2021-07-27 12:34:56 +00:00
|
|
|
|
|
|
|
#######################
|
|
|
|
## Only Copy Assets
|
|
|
|
#######################
|
2022-02-14 14:35:16 +00:00
|
|
|
FROM scratch as angular-export
|
|
|
|
COPY --from=angular-build /console/dist/console .
|